Best code examples for Android Activity class (android.app.Activity)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android Activity class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Android Activity examples from Open Source projects
This code example shows how to use the following methods: setProgressBarIndeterminate, setProgressBarIndeterminateVisibility, setProgressBarVisibility, setTitle
				progressDialog.dismiss();
			} 
			progressDialog = null;
		} else { 
			Activity parent = (Activity) proxy.getActivity();
			parent.setProgressBarIndeterminate(false);
			parent.setProgressBarIndeterminateVisibility(false);
			parent.setProgressBarVisibility(false);
			parent.setTitle(statusBarTitle);
			statusBarTitle = null;
		} 
		visible = false;
	} 
 
	@Override 
	public void onCancel(DialogInterface dialog) {
		visible = false;
		fireEvent(TiC.EVENT_CANCEL, null); 
	} 
} 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: getString, getPackageName, getResources
This code example shows how to use the following methods: addAction, addDataScheme, registerReceiver
    public void onResume() { 
        super.onResume(); 
        updateList(); 
 
        // listen for package changes 
        IntentFilter filter = new IntentFilter();
        filter.addAction(Intent.ACTION_PACKAGE_ADDED);
        filter.addAction(Intent.ACTION_PACKAGE_CHANGED);
        filter.addAction(Intent.ACTION_PACKAGE_REMOVED);
        filter.addAction(Intent.ACTION_PACKAGE_REPLACED);
        filter.addDataScheme("package");
        getActivity().registerReceiver(mPackageReceiver, filter);
 
        mCR.registerContentObserver(ENABLED_NOTIFICATION_LISTENERS_URI, false, mSettingsObserver);
    } 
 
    @Override 
    public void onPause() { 
        super.onPause(); 
 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: addAction, registerReceiver
        super.onResume(); 
        if (mOkButton == null) {
            mOkButton = mAlertDialog.getButton(DialogInterface.BUTTON_POSITIVE);
            mOkButton.setEnabled(mDeviceNameEdited);    // Ok button enabled after user edits
        } 
        IntentFilter filter = new IntentFilter();
        filter.addAction(BluetoothAdapter.ACTION_STATE_CHANGED);
        filter.addAction(BluetoothAdapter.ACTION_LOCAL_NAME_CHANGED);
        getActivity().registerReceiver(mReceiver, filter);
    } 
 
    @Override 
    public void onPause() { 
        super.onPause(); 
        getActivity().unregisterReceiver(mReceiver);
    } 
 
    void updateDeviceName() { 
        if (mLocalAdapter != null && mLocalAdapter.isEnabled()) {
            mDeviceNameUpdated = true;
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: get
        super(context, executor);
    } 
 
    @Override 
    public final ResultT call() throws Exception { 
        final AccountManager manager = AccountManager.get(activity);
        final Account account = AccountUtils.getAccount(manager, activity);
 
        accountScope.enterWith(account, manager);
        try { 
            contextScope.enter(getContext());
            try { 
                return run(account);
            } catch (IOException e) {
                // Retry task if authentication failure occurs and account is 
                // successfully updated 
                if (AccountUtils.isUnauthorized(e)
                        && AccountUtils.updateAccount(account, activity))
                    return run(account);
                else 

9
CodeRank
Related Android Activity Questions & Answers:
Other Android Activity Examples
3:	import android.os.Bundle;
4:	
5:	public class ScaleDetectorTestActivity extends Activity {
6:	  /** Called when the activity is first created. */
7:	  @Override

Read More

See Code Examples for Android Activity Methods: