Android Activity - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android Activity class.

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
10
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
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
Connect your IDE to all the code out there  Get Codota for Java
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
Connect your IDE to all the code out there  Get Codota for Java
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
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods: get
     */ 
    protected abstract D getAccountFailureData(); 
 
    @Override 
    public final D loadInBackground() { 
        final AccountManager manager = AccountManager.get(activity);
        final Account account;
        try { 
            account = AccountUtils.getAccount(manager, activity);
        } catch (IOException e) {
            return getAccountFailureData(); 
        } catch (AccountsException e) {
            return getAccountFailureData(); 
        } 
 
        accountScope.enterWith(account, manager);
        try { 
            contextScope.enter(getContext());
            try { 
                return load(account);
Full Snippet Info
8
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods: getActivity, getApplicationContext, getClass
 
	private MoSyncNFCForegroundUtil(Activity activity, NfcAdapter nfc) {
	    this.activity = activity;
	    this.nfc = nfc;
 
	    intent = PendingIntent.getActivity(activity, 0, new Intent(activity, activity.getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), 0);
 
	    // TODO: NDEF!? 
	    IntentFilter ndef = new IntentFilter(NfcAdapter.ACTION_TECH_DISCOVERED);
 
//	    try { 
//	        ndef.addDataType("*/*"); 
//	    } catch (MalformedMimeTypeException e) { 
//	        throw new RuntimeException("Unable to speciy */* Mime Type", e); 
//	    } 
 
	    intentFilters = new IntentFilter[] { ndef };
 
	    // TODO: READ FROM NFC.XML OR SMTHG 
	    techLists = new String[][] {

8
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods: finish, startActivity
			}); 
			alertDialogBuilder.setNegativeButton(android.R.string.cancel, new OnClickListener() {
				@Override 
				public void onClick(final DialogInterface pDialog, final int pWhich) {
					if(pCancelIntent != null) {
						pActivity.startActivity(pCancelIntent);
					} 
					pActivity.finish();
				} 
			}) 
			.create().show();
			return true; 
		}else{ 
			return false; 
		} 
	} 
 
	// =========================================================== 
	// Inner and Anonymous Classes 
	// =========================================================== 
Full Snippet Info
9
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods: startActivityForResult
8
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods: getSystemService, getResources
		if (collection == null) {
			this.collection = new GCAccountMediaCollection();
		} else { 
			this.collection = collection;
		} 
		loader = ImageLoader.getLoader(context);
		inflater = (LayoutInflater) context
				.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		displayMetrics = context.getResources().getDisplayMetrics();
	} 
 
	@Override 
	public int getCount() { 
		return collection.size();
	} 
 
	@Override 
	public GCAccountMediaModel getItem(int position) {
		return collection.get(position);
	} 
Full Snippet Info
8
CodeRank
Connect your IDE to all the code out there  Get Codota for Java

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: