Intent getAction - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Intent getAction method.

This code example shows how to use the following methods: getAction, getParcelableExtra
  } 
 
  private BroadcastReceiver plugin=new BroadcastReceiver() {
    @Override 
    public void onReceive(Context ctxt, Intent i) { 
      if (ACTION_REGISTER_PLUGIN.equals(i.getAction())) { 
        pluginCN=(ComponentName)i.getParcelableExtra(EXTRA_COMPONENT); 
      } 
      else if (ACTION_DELIVER_CONTENT.equals(i.getAction())) { 
        RemoteViews rv=(RemoteViews)i.getParcelableExtra(EXTRA_CONTENT); 
        ViewGroup frame=(ViewGroup)findViewById(android.R.id.content); 
 
        frame.removeAllViews(); 
 
        View pluginView=rv.apply(RemoteViewsHostActivity.this, frame); 
 
        frame.addView(pluginView); 
      } 
    } 
  }; 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getAction
 
    private static BootstrapAccountAuthenticator AUTHENTICATOR = null;
 
    @Override 
    public IBinder onBind(Intent intent) {
        return intent.getAction().equals(ACTION_AUTHENTICATOR_INTENT) ? getAuthenticator().getIBinder() : null;
    } 
 
    private BootstrapAccountAuthenticator getAuthenticator() { 
        if (AUTHENTICATOR == null)
            AUTHENTICATOR = new BootstrapAccountAuthenticator(this);
        return AUTHENTICATOR;
    } 
} 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getAction, getParcelableExtra
    SupplicantState mSupplicantState;
 
    private class WifiStateListener extends BroadcastReceiver {
        @Override 
        public void onReceive(Context context, Intent intent) {
            String action = intent.getAction();
            if (action.equals(WifiManager.WIFI_STATE_CHANGED_ACTION)) {
                mWifiState = intent.getIntExtra(WifiManager.EXTRA_WIFI_STATE,
                        WifiManager.WIFI_STATE_UNKNOWN);
                switch (mWifiState) {
                    case WifiManager.WIFI_STATE_DISABLING:
                        if (mDisableBroadcastCounter == 0) mDisableBroadcastCounter++;
                        break; 
                    case WifiManager.WIFI_STATE_DISABLED:
                        if (mDisableBroadcastCounter == 1) mDisableBroadcastCounter++;
                        break; 
                    case WifiManager.WIFI_STATE_ENABLING:
                        if (mEnableBroadcastCounter == 0) mEnableBroadcastCounter++;
                        break; 
                    case WifiManager.WIFI_STATE_ENABLED:

7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getAction, getIntExtra
    } 
 
    private final BroadcastReceiver mIntentReceiver = new BroadcastReceiver() {
        @Override 
        public void onReceive(Context context, Intent intent) { 
            String action = intent.getAction(); 
 
            if (Intent.ACTION_BATTERY_CHANGED.equals(action)) { 
                mBatteryLevel = intent.getIntExtra(BatteryManager.EXTRA_LEVEL, 0); 
                mBatteryCharging = intent.getIntExtra(BatteryManager.EXTRA_STATUS, 0) == BatteryManager.BATTERY_STATUS_CHARGING; 
                if (mBatteryCharging && mBatteryLevel < 100) { 
                    start(); 
                } else { 
                    stop(); 
                } 
                setProgress(mBatteryLevel); 
            } else if (Intent.ACTION_SCREEN_OFF.equals(action)) { 
                stop(); 
            } else if (Intent.ACTION_SCREEN_ON.equals(action)) { 
                if (mBatteryCharging && mBatteryLevel < 100) { 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getAction
  private          String            challenge;
  private          long              verificationStartTime;
 
  @Override 
  public int onStartCommand(final Intent intent, int flags, int startId) {
    if (intent != null && intent.getAction().equals(REGISTER_NUMBER_ACTION)) {
      executor.execute(new Runnable() {
        @Override 
        public void run() { 
          handleRegistrationIntent(intent);
        } 
      }); 
    } 
 
    return START_NOT_STICKY;
  } 
 
  @Override 
  public void onDestroy() { 
    super.onDestroy(); 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Intent getAction Questions & Answers:

Other Intent getAction Examples

38:		 */
39:		private void handleIntent(Intent intent) {
40:			if (Intent.ACTION_SEARCH.equals(intent.getAction())) {
41:				String query = intent.getStringExtra(SearchManager.QUERY);
42:

Read More

getAction Method Overview
Retrieve the general action to be performed, such as ACTION_VIEW.
See Code Examples for other Android Intent Methods: