IT. Expert System.

Android Reference

NativeActivity


android.app

Class NativeActivity

    • Field Detail

      • META_DATA_LIB_NAME

        public static final String META_DATA_LIB_NAME
        Optional meta-that can be in the manifest for this component, specifying the name of the native shared library to load. If not specified, "main" is used.
        See Also:
        Constant Field Values
      • META_DATA_FUNC_NAME

        public static final String META_DATA_FUNC_NAME
        Optional meta-that can be in the manifest for this component, specifying the name of the main entry point for this native activity in the META_DATA_LIB_NAME native code. If not specified, "ANativeActivity_onCreate" is used.
        See Also:
        Constant Field Values
    • Constructor Detail

      • NativeActivity

        public NativeActivity()
    • Method Detail

      • onDestroy

        protected void onDestroy()
        Description copied from class: Activity
        Perform any final cleanup before an activity is destroyed. This can happen either because the activity is finishing (someone called Activity.finish() on it, or because the system is temporarily destroying this instance of the activity to save space. You can distinguish between these two scenarios with the Activity.isFinishing() method.

        Note: do not count on this method being called as a place for saving data! For example, if an activity is editing data in a content provider, those edits should be committed in either Activity.onPause() or Activity.onSaveInstanceState(android.os.Bundle), not here. This method is usually implemented to free resources like threads that are associated with an activity, so that a destroyed activity does not leave such things around while the rest of its application is still running. There are situations where the system will simply kill the activity's hosting process without calling this method (or any others) in it, so it should not be used to do things that are intended to remain around after the process goes away.

        Derived classes must call through to the super class's implementation of this method. If they do not, an exception will be thrown.

        Overrides:
        onDestroy in class Activity
        See Also:
        Activity.onPause(), Activity.onStop(), Activity.finish(), Activity.isFinishing()
      • onPause

        protected void onPause()
        Description copied from class: Activity
        Called as part of the activity lifecycle when an activity is going into the background, but has not (yet) been killed. The counterpart to Activity.onResume().

        When activity B is launched in front of activity A, this callback will be invoked on A. B will not be created until A's Activity.onPause() returns, so be sure to not do anything lengthy here.

        This callback is mostly used for saving any persistent state the activity is editing, to present a "edit in place" model to the user and making sure nothing is lost if there are not enough resources to start the new activity without first killing this one. This is also a good place to do things like stop animations and other things that consume a noticeable amount of CPU in order to make the switch to the next activity as fast as possible, or to close resources that are exclusive access such as the camera.

        In situations where the system needs more memory it may kill paused processes to reclaim resources. Because of this, you should be sure that all of your state is saved by the time you return from this function. In general Activity.onSaveInstanceState(android.os.Bundle) is used to save per-instance state in the activity and this method is used to store global persistent data (in content providers, files, etc.)

        After receiving this call you will usually receive a following call to Activity.onStop() (after the next activity has been resumed and displayed), however in some cases there will be a direct call back to Activity.onResume() without going through the stopped state.

        Derived classes must call through to the super class's implementation of this method. If they do not, an exception will be thrown.

        Overrides:
        onPause in class Activity
        See Also:
        Activity.onResume(), Activity.onSaveInstanceState(android.os.Bundle), Activity.onStop()
      • onConfigurationChanged

        public void onConfigurationChanged(Configuration newConfig)
        Description copied from class: Activity
        Called by the system when the device configuration changes while your activity is running. Note that this will only be called if you have selected configurations you would like to handle with the android.R.attr#configChanges attribute in your manifest. If any configuration change occurs that is not selected to be reported by that attribute, then instead of reporting it the system will stop and restart the activity (to have it launched with the new configuration).

        At the time that this function has been called, your Resources object will have been updated to return resource values matching the new configuration.

        Specified by:
        onConfigurationChanged in interface ComponentCallbacks
        Overrides:
        onConfigurationChanged in class Activity
        Parameters:
        newConfig - The new device configuration.
      • onLowMemory

        public void onLowMemory()
        Description copied from interface: ComponentCallbacks
        This is called when the overall system is running low on memory, and would like actively running process to try to tighten their belt. While the exact point at which this will be called is not defined, generally it will happen around the time all background process have been killed, that is before reaching the point of killing processes hosting service and foreground UI that we would like to avoid killing.

        Applications that want to be nice can implement this method to release any caches or other unnecessary resources they may be holding on to. The system will perform a gc for you after returning from this method.

        Specified by:
        onLowMemory in interface ComponentCallbacks
        Overrides:
        onLowMemory in class Activity
      • onWindowFocusChanged

        public void onWindowFocusChanged(boolean hasFocus)
        Description copied from class: Activity
        Called when the current Window of the activity gains or loses focus. This is the best indicator of whether this activity is visible to the user. The default implementation clears the key tracking state, so should always be called.

        Note that this provides information about global focus state, which is managed independently of activity lifecycles. As such, while focus changes will generally have some relation to lifecycle changes (an activity that is stopped will not generally get window focus), you should not rely on any particular order between the callbacks here and those in the other lifecycle methods such as Activity.onResume().

        As a general rule, however, a resumed activity will have window focus... unless it has displayed other dialogs or popups that take input focus, in which case the activity itself will not have focus when the other windows have it. Likewise, the system may display system-level windows (such as the status bar notification panel or a system alert) which will temporarily take window input focus without pausing the foreground activity.

        Specified by:
        onWindowFocusChanged in interface Window.Callback
        Overrides:
        onWindowFocusChanged in class Activity
        Parameters:
        hasFocus - Whether the window of this activity has focus.
        See Also:
        Activity.hasWindowFocus(), Activity.onResume(), View.onWindowFocusChanged(boolean)
      • dispatchKeyEvent

        public boolean dispatchKeyEvent(KeyEvent event)
        Description copied from class: Activity
        Called to process key events. You can override this to intercept all key events before they are dispatched to the window. Be sure to call this implementation for key events that should be handled normally.
        Specified by:
        dispatchKeyEvent in interface Window.Callback
        Overrides:
        dispatchKeyEvent in class Activity
        Parameters:
        event - The key event.
        Returns:
        boolean Return true if this event was consumed.
      • surfaceCreated

        public void surfaceCreated(SurfaceHolder holder)
        Description copied from interface: SurfaceHolder.Callback
        This is called immediately after the surface is first created. Implementations of this should start up whatever rendering code they desire. Note that only one thread can ever draw into a Surface, so you should not draw into the Surface here if your normal rendering will be in another thread.
        Specified by:
        surfaceCreated in interface SurfaceHolder.Callback
        Parameters:
        holder - The SurfaceHolder whose surface is being created.
      • surfaceChanged

        public void surfaceChanged(SurfaceHolder holder,
                          int format,
                          int width,
                          int height)
        Description copied from interface: SurfaceHolder.Callback
        This is called immediately after any structural changes (format or size) have been made to the surface. You should at this point update the imagery in the surface. This method is always called at least once, after SurfaceHolder.Callback.surfaceCreated(android.view.SurfaceHolder).
        Specified by:
        surfaceChanged in interface SurfaceHolder.Callback
        Parameters:
        holder - The SurfaceHolder whose surface has changed.
        format - The new PixelFormat of the surface.
        width - The new width of the surface.
        height - The new height of the surface.
      • surfaceDestroyed

        public void surfaceDestroyed(SurfaceHolder holder)
        Description copied from interface: SurfaceHolder.Callback
        This is called immediately before a surface is being destroyed. After returning from this call, you should no longer try to access this surface. If you have a rendering thread that directly accesses the surface, you must ensure that thread is no longer touching the Surface before returning from this function.
        Specified by:
        surfaceDestroyed in interface SurfaceHolder.Callback
        Parameters:
        holder - The SurfaceHolder whose surface is being destroyed.


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 1851 / 96490350. Delta: 0.05257 с