List of usage examples for android.os Bundle getString
@Nullable
public String getString(@Nullable String key)
From source file:net.idlesoft.android.apps.github.activities.CommitsList.java
@Override public void onCreate(final Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.commits_list); mPrefs = getSharedPreferences(Hubroid.PREFS_NAME, 0); mUsername = mPrefs.getString("username", ""); mPassword = mPrefs.getString("password", ""); mGapi.authenticate(mUsername, mPassword); ((ImageButton) findViewById(R.id.btn_search)).setOnClickListener(new OnClickListener() { public void onClick(final View v) { startActivity(new Intent(CommitsList.this, Search.class)); }/*from ww w . j ava 2 s .co m*/ }); final TextView title = (TextView) findViewById(R.id.tv_page_title); title.setText("Recent Commits"); mCommitListView = (ListView) findViewById(R.id.lv_commits_list_list); final Bundle extras = getIntent().getExtras(); if (extras != null) { mRepoName = extras.getString("repo_name"); mRepoOwner = extras.getString("repo_owner"); mBranchName = extras.getString("branch_name"); } }
From source file:org.ohmage.sync.StreamSyncAdapter.java
@Override public void onPerformSync(Account account, Bundle extras, String authority, ContentProviderClient provider, SyncResult syncResult) {/*from w w w . j a v a 2 s . c o m*/ String streamId = extras.getString(EXTRA_STREAM_ID); Long streamVersion = extras.getLong(EXTRA_STREAM_VERSION); performSyncForStreams(account, new Streams(provider, account, streamId, streamVersion), new StreamWriterOutput(provider), syncResult); }
From source file:li.barter.fragments.PasswordResetFragment.java
@Override public View onCreateView(final LayoutInflater inflater, final ViewGroup container, final Bundle savedInstanceState) { init(container, savedInstanceState); final View view = inflater.inflate(R.layout.fragment_reset_password, null); final Bundle extras = getArguments(); if (extras != null) { mEmailId = extras.getString(Keys.EMAIL); }/* www .j a v a2 s .c o m*/ mResetButton = (Button) view.findViewById(R.id.button_reset_password); mNewPasswordEditText = (EditText) view.findViewById(R.id.edit_text_newpassword); mConfirmNewPasswordEditText = (EditText) view.findViewById(R.id.edit_text_confirmpassword); mTokenEditText = (EditText) view.findViewById(R.id.edit_text_token); mResetButton.setOnClickListener(this); return view; }
From source file:de.elanev.studip.android.app.frontend.forums.ForumEntryFragment.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Bundle args = getArguments(); mEntryId = args.getString(ForumEntry.ID); mContent = args.getString(ForumEntry.CONTENT); mSubject = args.getString(ForumEntry.SUBJECT); mDate = args.getLong(ForumEntry.DATE); mFullName = args.getString(User.NAME); mAvatar = args.getString(User.AVATAR); mAdapter = new ForumEntryAdapter(new ArrayList<ForumEntry>(), new ListItemClicks() { @Override// www . j a va 2s . c o m public void onListItemClicked(View v, int position) { } }, getActivity()); mObserver = new RecyclerView.AdapterDataObserver() { @Override public void onChanged() { super.onChanged(); mEmptyView.setText(R.string.no_entries); toggleEmptyView(mAdapter.isEmpty()); } }; mAdapter.registerAdapterDataObserver(mObserver); }
From source file:de.grobox.blitzmail.NotificationHandlerActivity.java
@Override protected void onNewIntent(Intent intent) { Bundle extras = intent.getExtras(); // show dialog for server errors if (extras != null && extras.getString("ContentTitle").equals(getString(R.string.error))) { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle(getString(R.string.app_name) + " - " + getString(R.string.error)); builder.setMessage(extras.getString("ContentText")); builder.setIcon(android.R.drawable.ic_dialog_alert); // Add the buttons builder.setNegativeButton(getResources().getString(R.string.dismiss), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { deleteMail();/*w w w . j a v a2s . co m*/ // User clicked Cancel button, close this Activity finish(); } }); builder.setNeutralButton(getResources().getString(R.string.send_later), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { // User clicked Cancel button if (BuildConfig.PRO) { // close this Activity finish(); } else { AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setTitle(getString(R.string.app_name)); builder.setMessage(getString(R.string.error_lite_version)); builder.setIcon(android.R.drawable.ic_dialog_info); // Add the buttons builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { public void onClick(DialogInterface lite_dialog, int id) { Uri uri = Uri.parse( "https://play.google.com/store/apps/details?id=de.grobox.blitzmail.pro"); Intent intent = new Intent(Intent.ACTION_VIEW, uri); if (intent.resolveActivity(getPackageManager()) != null) { startActivity(intent); } lite_dialog.dismiss(); finish(); } }); builder.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() { public void onClick(DialogInterface lite_dialog, int id) { lite_dialog.dismiss(); finish(); } }); // Create and show the AlertDialog AlertDialog lite_dialog = builder.create(); lite_dialog.setCanceledOnTouchOutside(false); lite_dialog.show(); } } }); builder.setPositiveButton(getResources().getString(R.string.try_again), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { // Prepare start of new activity Intent intent = new Intent(context, SendActivity.class); intent.setAction("BlitzMailReSend"); intent.putExtra("mail", mMail.toString()); finish(); startActivity(intent); } }); // Create and show the AlertDialog AlertDialog dialog = builder.create(); dialog.setCanceledOnTouchOutside(false); dialog.show(); } else { // close activity finish(); } }
From source file:gov.wa.wsdot.android.wsdot.ui.MountainPassItemCameraFragment.java
@Override public void onAttach(Activity activity) { super.onAttach(activity); Bundle args = activity.getIntent().getExtras(); camerasArray = args.getString("Cameras"); }
From source file:com.brodev.socialapp.view.ChangePassword.java
/** Called when the activity is first created. */ @Override//www .ja v a2 s. c om public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.change_password); getSupportActionBar().setDisplayHomeAsUpEnabled(true); phraseManage = new PhraseManager(getApplicationContext()); Bundle bundle = getIntent().getExtras(); user = (User) getApplicationContext(); password = bundle.getString("password"); password_salt = bundle.getString("password_salt"); initView(); }
From source file:com.irccloud.android.fragment.WhoisFragment.java
@Override public void setArguments(Bundle args) { event = new IRCCloudJSONObject(args.getString("event")); }
From source file:com.df.app.carsChecked.CarReportActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_car_report); Bundle bundle = getIntent().getExtras(); if (!bundle.containsKey("jsonString")) { finish();/*from w ww .j a v a2 s . co m*/ } String jsonString = bundle.getString("jsonString"); InitViewPager(jsonString); InitTextView(); }
From source file:com.madgag.agit.BlobViewFragment.java
@Override public Loader<BlobView> onCreateLoader(int id, Bundle b) { return new AsyncLoader<BlobView>(getActivity()) { public BlobView loadInBackground() { Bundle args = getArguments(); try { Repository repo = new FileRepository(args.getString(GITDIR)); ObjectId revision = repo.resolve(args.getString(UNTIL_REVS)); RevWalk revWalk = new RevWalk(repo); RevCommit commit = revWalk.parseCommit(revision); TreeWalk treeWalk = TreeWalk.forPath(repo, args.getString(PATH), commit.getTree()); ObjectId blobId = treeWalk.getObjectId(0); ObjectLoader objectLoader = revWalk.getObjectReader().open(blobId, Constants.OBJ_BLOB); ObjectStream binaryTestStream = objectLoader.openStream(); boolean blobIsBinary = RawText.isBinary(binaryTestStream); binaryTestStream.close(); Log.d(TAG, "blobIsBinary=" + blobIsBinary); return blobIsBinary ? new BinaryBlobView(objectLoader, treeWalk.getNameString()) : new TextBlobView(objectLoader); } catch (IOException e) { throw new RuntimeException(e); }/*from www. ja v a 2s . c o m*/ } }; }