Intent messageIntent =newIntent(this,ShowMessageActivity.class);// A web page URLmessageIntent.setData(Uri.parse("http://www.google.com")); // a Sample file URImessageIntent.setData(Uri.fromFile(newFile("/sdcard/sample.jpg")));// A sample content: URI for your app's data modelmessageIntent.setData(Uri.parse("content://mysample.provider/data")); // Custom URI messageIntent.setData(Uri.parse("custom:"+ dataID + buttonId));startActivity(messageIntent);
Intent messageIntent =newIntent(this,ShowMessageActivity.class);// Tek tek koymamessageIntent.putExtra(EXTRA_MESSAGE,"this is my message");messageIntent.putExtra(EXTRA_POSITION_X,100);messageIntent.putExtra(EXTRA_POSITION_Y,500);// Bundle yapısıBundle extras =newBundle();extras.putString(EXTRA_MESSAGE,"this is my message");extras.putInt(EXTRA_POSITION_X,100);extras.putInt(EXTRA_POSITION_Y,500);messageIntent.putExtras(extras);startActivity(messageIntent);
Intent intent =getIntent();// Data almaUri locationUri =intent.getData();// Extra almaString message =intent.getStringExtra(MainActivity.EXTRA_MESSAGE); int positionX =intent.getIntExtra(MainActivity.EXTRA_POSITION_X);int positionY =intent.getIntExtra(MainActivity.EXTRA_POSITION_Y);// Bundle almaBundle extras =intent.getExtras();String message =extras.getString(MainActivity.EXTRA_MESSAGE);
🔙 Başlatılan Activity Üzerinden Intent Verilerini Alma
Intent intent =getIntent();// Data almaUri locationUri =intent.getData();// Extra almaString message =intent.getStringExtra(MainActivity.EXTRA_MESSAGE); int positionX =intent.getIntExtra(MainActivity.EXTRA_POSITION_X);int positionY =intent.getIntExtra(MainActivity.EXTRA_POSITION_Y);// Bundle almaBundle extras =intent.getExtras();String message =extras.getString(MainActivity.EXTRA_MESSAGE);
🔙 Intent Verilerini Eski Activity'e Aktarma
🎈 Activity'i startActivityForResult() ile Başlatma