List of usage examples for android.content Intent toString
@Override
public String toString()
From source file:com.posagent.fragments.RegisterFragment.java
@Override public void onActivityResult(final int requestCode, int resultCode, final Intent data) { super.onActivityResult(requestCode, resultCode, data); if (resultCode != Activity.RESULT_OK) return;// w w w . j a v a2s .c o m switch (requestCode) { case Constants.CommonInputerConstant.REQUEST_CODE: Bundle bundle = data.getExtras(); String content = bundle.getString(Constants.CommonInputerConstant.VALUE_KEY); tvContent.setText(content); Log.d(TAG, data.toString()); break; case Constants.CommonInputerConstant.REQUEST_CITY_CODE: Bundle bundle2 = data.getExtras(); cityName = bundle2.getString(com.example.zf_android.trade.Constants.CityIntent.CITY_NAME); cityId = bundle2.getInt(com.example.zf_android.trade.Constants.CityIntent.CITY_ID); tvCityName.setText(cityName); break; case Constants.REQUEST_CODE: String url = data.getStringExtra("url"); updatePhotoUrl(url); break; case REQUEST_UPLOAD_IMAGE: case REQUEST_TAKE_PHOTO: { final Handler handler = new Handler() { @Override public void handleMessage(Message msg) { if (msg.what == 1) { String url = (String) msg.obj; updatePhotoUrl(url); } else { CommonUtil.toastShort(getActivity(), getString(R.string.toast_upload_failed)); } } }; photoManager.onActivityResult(requestCode, resultCode, data, handler); break; } } }
From source file:com.notalenthack.blaster.CommandActivity.java
private void setupFilter() { final IntentFilter filter = new IntentFilter(); filter.addAction(Constants.ACTION_REFRESH_STATUS); mReceiver = new BroadcastReceiver() { @Override/* www.j a v a 2 s . c om*/ public void onReceive(Context context, Intent intent) { // Got intent to clean up if (intent.getAction().equals(Constants.ACTION_REFRESH_STATUS)) { if (D) Log.d(TAG, "onReceive intent " + intent.toString()); List<Command> commands = mListAdapter.getCommands(); // this list should be in the same order as in the ListBox int i = 0; for (Command cmd : commands) { if (cmd.getDisplayStatus()) { mSerialService.sendStatusCommand(cmd.getCommandStat(), i, false); } i++; } } } }; registerReceiver(mReceiver, filter); }
From source file:com.cerema.cloud2.ui.activity.ShareActivity.java
@Override protected void onNewIntent(Intent intent) { // Verify the action and get the query if (Intent.ACTION_SEARCH.equals(intent.getAction())) { String query = intent.getStringExtra(SearchManager.QUERY); Log_OC.w(TAG, "Ignored Intent requesting to query for " + query); } else if (UsersAndGroupsSearchProvider.ACTION_SHARE_WITH.equals(intent.getAction())) { Uri data = intent.getData();/*from w ww . ja va 2 s . co m*/ String dataString = intent.getDataString(); String shareWith = dataString.substring(dataString.lastIndexOf('/') + 1); doShareWith(shareWith, data.getAuthority()); } else { Log_OC.wtf(TAG, "Unexpected intent " + intent.toString()); } }
From source file:edu.cens.loci.ui.PlaceListActivity.java
protected void onActivityResult(int requestCode, int resultCode, Intent data) { MyLog.i(LociConfig.D.UI.DEBUG, TAG,//w ww . j a va 2 s. c om "onActivityResult:" + String.format(" requestCode=%d resultCode=%d ", requestCode, resultCode)); if (data != null) MyLog.d(LociConfig.D.UI.DEBUG, TAG, "onActivityResult:" + data.toString()); switch (requestCode) { case SUBACTIVITY_NEW_PLACE: if (resultCode == RESULT_OK) { setResult(RESULT_OK, data); finish(); } break; case SUBACTIVITY_VIEW_PLACE: if (resultCode == RESULT_OK) { } case SUBACTIVITY_FILTER: if (resultCode == RESULT_OK) { setResult(RESULT_OK, data); finish(); } } }
From source file:edu.cens.loci.ui.VisitDetailActivity.java
protected void onActivityResult(int requestCode, int resultCode, Intent data) { MyLog.d(LociConfig.D.UI.DEBUG, TAG,/*from w ww . j a v a 2 s .co m*/ "onActivityResult:" + String.format(" requestCode=%d resultCode=%d ", requestCode, resultCode)); if (data != null) MyLog.d(LociConfig.D.UI.DEBUG, TAG, "onActivityResult:" + data.toString()); switch (requestCode) { case SUBACTIVITY_ADD_PLACE: if (resultCode == RESULT_OK) { // created or add to existing place successfully. update visits' placeid. final long placeId = ContentUris.parseId(data.getData()); final long visitId = ContentUris.parseId(getIntent().getData()); MyLog.d(LociConfig.D.UI.DEBUG, TAG, "[Update] placeId=" + placeId + ", visitId=" + visitId); mDbUtils.updateVisitPlaceId(visitId, placeId); } break; case SUBACTIVITY_CHANGE_PLACE: if (resultCode == RESULT_OK) { // created or add to existing place successfully. update visits' placeid //MyLog.d(LociConfig.D.UI.DEBUG, TAG, "[VisitDetail] data:" + data.getData().toString()); final long placeId = ContentUris.parseId(data.getData()); final long visitId = ContentUris.parseId(getIntent().getData()); MyLog.d(LociConfig.D.UI.DEBUG, TAG, "[Update] placeId=" + placeId + ", visitId=" + visitId); mDbUtils.updateVisitPlaceId(visitId, placeId); } } }
From source file:com.synox.android.ui.activity.ShareActivity.java
@Override protected void onNewIntent(Intent intent) { // Verify the action and get the query if (Intent.ACTION_SEARCH.equals(intent.getAction())) { String query = intent.getStringExtra(SearchManager.QUERY); Log_OC.w(TAG, "Ignored Intent requesting to query for " + query); } else if (UsersAndGroupsSearchProvider.ACTION_SHARE_WITH.equals(intent.getAction())) { Uri data = intent.getData();// w w w . j a v a2 s . c o m String dataString = intent.getDataString(); String shareWith = dataString.substring(dataString.lastIndexOf('/') + 1); doShareWith(shareWith, UsersAndGroupsSearchProvider.DATA_GROUP.equals(data.getAuthority())); } else { Log_OC.wtf(TAG, "Unexpected intent " + intent.toString()); } }
From source file:com.ereinecke.eatsafe.MainActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); boolean scanner = false; setContentView(R.layout.activity_main); View rootView = findViewById(android.R.id.content); Toolbar toolbar = findViewById(R.id.app_bar); setSupportActionBar(toolbar);//from w w w.j a v a 2s . c om //noinspection ConstantConditions getSupportActionBar().setDisplayShowTitleEnabled(false); MobileAds.initialize(getApplicationContext(), getString(R.string.app_id)); // See if activity was started by widget Intent intent = getIntent(); // may not be needed here if (intent != null) { Logd(LOG_TAG, "in onCreate(), intent: " + intent.toString()); String message = intent.getStringExtra(Constants.MESSAGE_KEY); if (message != null && message.equals(Constants.ACTION_SCAN_BARCODE)) { scanner = true; } } // messageReceiver catches barcode from service or fragment display requests. messageReceiver = new MessageReceiver(); isTablet = (findViewById(R.id.dual_pane) != null); if (findViewById(R.id.tab_container) != null) { Bundle bundle = new Bundle(); bundle.putInt(Constants.CURRENT_FRAGMENT, currentFragment); TabPagerFragment tabPagerFragment = new TabPagerFragment(); tabPagerFragment.setArguments(bundle); getSupportFragmentManager().beginTransaction().replace(R.id.tab_container, new TabPagerFragment()) .commit(); // Handle right-hand pane on dual-pane layouts if (isTablet && (savedInstanceState == null)) { getSupportFragmentManager().beginTransaction() .replace(R.id.right_pane_container, new SplashFragment()).commit(); } if (scanner) { launchScannerIntent(); } } // Silent login at initial startup if (savedInstanceState == null) { if (silentLogin()) { Logd(LOG_TAG, "Login successful."); } else { Logd(LOG_TAG, "Login failed"); } } // ATTENTION: This was auto-generated to handle app links. Intent appLinkIntent = getIntent(); String appLinkAction = appLinkIntent.getAction(); Uri appLinkData = appLinkIntent.getData(); }
From source file:org.openhab.habdroid.ui.OpenHABWidgetListActivity.java
/** * This method is called when activity receives a new intent while running *//* w w w.j av a 2 s.com*/ @Override public void onNewIntent(Intent newIntent) { Log.d(TAG, "New intent received = " + newIntent.toString()); if (newIntent.getDataString() != null) { onNfcTag(newIntent.getDataString(), true); } }
From source file:com.frostwire.android.gui.services.EngineService.java
@Override public int onStartCommand(Intent intent, int flags, int startId) { async(this, EngineService::cancelAllNotificationsTask); if (intent == null) { return START_NOT_STICKY; }// www . j av a2 s . c o m if (SHUTDOWN_ACTION.equals(intent.getAction())) { LOG.info("onStartCommand() - Received SHUTDOWN_ACTION"); new Thread("EngineService-onStartCommand(SHUTDOWN_ACTION) -> shutdownSupport") { @Override public void run() { shutdownSupport(); } }.start(); return START_NOT_STICKY; } LOG.info("FrostWire's EngineService started by this intent:"); LOG.info("FrostWire:" + intent.toString()); LOG.info("FrostWire: flags:" + flags + " startId: " + startId); async(this, EngineService::startPermanentNotificationUpdatesTask); return START_STICKY; }