List of usage examples for android.os Bundle get
@Nullable
public Object get(String key)
From source file:com.example.michael.bumpy.EditDetailsActivity.java
protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == REQUEST_IMAGE_CAPTURE && resultCode == RESULT_OK) { Bundle extras = data.getExtras(); Bitmap imageBitmap = (Bitmap) extras.get("data"); imageButtonToUpdate.setImageBitmap(imageBitmap); }//from w ww.j ava 2s. c o m }
From source file:com.example.hackinghealthclinification.app.ClinificationApp.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_clinification_app); initializeLaunchButtons();/*from w w w.ja va 2 s . com*/ mIsRegistered = false; // check if BroadcastReceiver registered IntentFilter filterSmsReceived = new IntentFilter("android.provider.Telephony.SMS_RECEIVED"); final SMSConfirmDialog.ConfirmDialogListener mListener = new SMSConfirmDialog.ConfirmDialogListener() { @Override public void onDialogPositiveClick(SMSConfirmDialog c) { // mContext.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("yes" // + mPhoneNumber))); SmsManager smsManager = SmsManager.getDefault(); smsManager.sendTextMessage(mServerNumber, null, "yes", null, null); } @Override public void onDialogNegativeClick(SMSConfirmDialog c) { SmsManager smsManager = SmsManager.getDefault(); smsManager.sendTextMessage(mServerNumber, null, "no", null, null); } }; mReceiver = new BroadcastReceiver() { public void onReceive(Context context, Intent intent) { mContext = context; Bundle pudsBundle = intent.getExtras(); Object[] pdus = (Object[]) pudsBundle.get("pdus"); SmsMessage messages = SmsMessage.createFromPdu((byte[]) pdus[0]); Log.i("Error with SMS ::: ", messages.getMessageBody()); if (messages.getMessageBody().contains(SMS_TRIGGER_KEY)) { mPhoneNumber = messages.getOriginatingAddress(); SMSConfirmDialog dialog = new SMSConfirmDialog(mListener, "Will you accept the new appointment: " + "\n" + messages.getMessageBody(), "Yes", "No"); dialog.show(getSupportFragmentManager(), null); } } }; this.registerReceiver(mReceiver, filterSmsReceived); mIsRegistered = true; }
From source file:com.kogitune.wearlocationwatchface.WatchFaceService.java
@Override public void onPreferenceChange(WearSharedPreference preference, String key, Bundle bundle) { Toast.makeText(this, key + ":" + bundle.get(key), Toast.LENGTH_LONG).show(); if (TextUtils.equals(key, getString(R.string.key_preference_time_text_accent))) { }//from w w w .ja va 2 s . c o m }
From source file:com.bukanir.android.activities.SearchActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { Log.d(TAG, "onCreate"); super.onCreate(savedInstanceState); supportRequestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); setContentView(R.layout.activity_movie_list); if (findViewById(R.id.movie_container) != null) { twoPane = true;//from ww w. j a v a 2 s.c o m } if (savedInstanceState != null) { movies = (ArrayList<Movie>) savedInstanceState.getSerializable("search"); } else { Bundle bundle = getIntent().getExtras(); movies = (ArrayList<Movie>) bundle.get("search"); } final ActionBar actionBar = getSupportActionBar(); actionBar.setDisplayShowTitleEnabled(true); actionBar.setDisplayHomeAsUpEnabled(true); beginTransaction(movies); }
From source file:com.afwsamples.testdpc.AddAccountActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mUserManager = (UserManager) getSystemService(Context.USER_SERVICE); mDevicePolicyManager = (DevicePolicyManager) getSystemService(Context.DEVICE_POLICY_SERVICE); mAdminComponentName = DeviceAdminReceiver.getComponentName(this); setContentView(R.layout.activity_add_account); SetupWizardLayout layout = (SetupWizardLayout) findViewById(R.id.setup_wizard_layout); layout.getNavigationBar().setNavigationBarListener(this); NavigationBar navigationBar = layout.getNavigationBar(); navigationBar.getBackButton().setEnabled(false); Bundle extras = getIntent().getExtras(); if (extras != null) { mNextActivityIntent = (Intent) extras.get(EXTRA_NEXT_ACTIVITY_INTENT); }//from w ww . j a v a2 s . c om }
From source file:org.deviceconnect.android.deviceplugin.theta.activity.ThetaDeviceSettingsActivity.java
@Override protected void onRestoreInstanceState(final Bundle savedInstanceState) { super.onRestoreInstanceState(savedInstanceState); if (savedInstanceState != null) { mSelectedModel = (ThetaDeviceModel) savedInstanceState.get(KEY_SELECTED_MODEL); }/* w w w . j a v a 2s .com*/ }
From source file:com.github.riotopsys.malforandroid2.activity.BaseDetailActivity.java
@SuppressWarnings("unchecked") @Override/* w w w. j a va 2s .c o m*/ protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (savedInstanceState != null) { currentDetail = (ChangeDetailViewRequest) savedInstanceState.get("currentDetail"); manualBackStack.clear(); manualBackStack.addAll((Collection<ChangeDetailViewRequest>) savedInstanceState.get("manualBackStack")); } }
From source file:com.jacr.instagramtrendreader.ImageDetails.java
@SuppressWarnings({ "unchecked" }) @Override//from w w w . ja va 2s. c om protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activitiy_image_details); if (getIntent() != null) { Bundle b = getIntent().getExtras(); listThumbnailKeys = (ArrayList<Integer>) b.get(KEY_THUMBNAIL_KEYS); listThumbnailData = (ArrayList<List<String>>) b.get(KEY_THUMBNAIL_DATA); final int currentKey = b.getInt(KEY_THUMBNAIL_ACTUAL_KEY); /* Views */ ViewPager mPager = (ViewPager) findViewById(R.id.pagerMain); CirclePageIndicator mIndicator = (CirclePageIndicator) findViewById(R.id.indicator); /* ActionBar */ Resources r = getResources(); actionBar = super.getActionBar(true); actionBar.setIcon(r.getDrawable(R.drawable.ic_menu_gallery)); /* Viewpager and Indicator */ mAdapter = new ViewPagerAdapter<ImageDetailsFragment>(getSupportFragmentManager()); /* * With the name of the image, extract the hash for the Associated * data (we don't use listThumbnailKeys for now). */ File[] imageList = Util.readFilesFromFileDirectory(this); for (int i = 0; i < imageList.length; i++) { int keyIterator = Integer.parseInt(imageList[i].getName()); String date = Util.nulo2Vacio(getThumbnailDataByKey(keyIterator, FeedReader.THUMBNAIL_DATE)); String author = Util.nulo2Vacio(getThumbnailDataByKey(keyIterator, FeedReader.THUMBNAIL_AUTHOR)); String tags = Util.nulo2Vacio(getThumbnailDataByKey(keyIterator, FeedReader.THUMBNAIL_TAGS)); String urlImage = Util.nulo2Vacio(getThumbnailDataByKey(keyIterator, FeedReader.THUMBNAIL_URL)); mAdapter.addFragment(ImageDetailsFragment.newInstance(imageList[i], urlImage, date, author, tags)); } mPager.setAdapter(mAdapter); mIndicator.setViewPager(mPager); mIndicator.setHorizontalScrollBarEnabled(true); mIndicator.setHorizontalFadingEdgeEnabled(true); mIndicator.setBackgroundColor(r.getColor(R.color.white)); mIndicator.setOnPageChangeListener(new ViewPager.OnPageChangeListener() { @Override public void onPageSelected(int arg0) { setDataRelationshipViewPager(arg0); } @Override public void onPageScrolled(int arg0, float arg1, int arg2) { } @Override public void onPageScrollStateChanged(int arg0) { } }); // Show image int idxKey = listThumbnailKeys.indexOf(currentKey); mPager.setCurrentItem(idxKey); setDataRelationshipViewPager(idxKey); } }
From source file:fr.umlv.lastproject.smart.browser.FileChooserActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); try {//from w w w.ja v a 2 s. co m pref = Preferences.create(this); } catch (PreferencesException e) { Toast.makeText(this, getString(R.string.unableLoadPref), Toast.LENGTH_LONG).show(); } setTheme(pref.getTheme()); setContentView(R.layout.chooser); mFragmentManager = getSupportFragmentManager(); mFragmentManager.addOnBackStackChangedListener(this); if (savedInstanceState == null) { Bundle bundle = getIntent().getExtras(); mPath = (String) bundle.get(PATH); addFragment(); } else { mPath = savedInstanceState.getString(PATH); } setTitle(mPath); }
From source file:com.bwie.myshops.view.DetailsActivity.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_view_pager); ViewPager mViewPager = (HackyViewPager) findViewById(R.id.view_pager); setContentView(mViewPager);/*from ww w . j a v a 2 s . co m*/ options = ImageLoaderUtils.initOptions(); // Bundle bundle = new Bundle(); bundle = this.getIntent().getExtras(); int index = bundle.getInt("index"); DetailsBean.DataBean.ProductBean dui = (DetailsBean.DataBean.ProductBean) bundle.get("photo"); listsStr.add(dui.getApp_long_image1()); listsStr.add(dui.getApp_long_image2()); listsStr.add(dui.getApp_long_image3()); listsStr.add(dui.getApp_long_image4()); mViewPager.setAdapter(new SamplePagerAdapter()); mViewPager.setCurrentItem(2); }