Code example for Intent

Methods: getIntExtragetStringExtra

0
      .setPositiveButton("OK", null)
      .show();
  } 
   
  private void handleResult(Intent i) {
    String result=i.getStringExtra(PAYLOAD);
    int resultCode=i.getIntExtra(RESULT_CODE, -1);
     
    if (resultCode==SUCCESS) {
      success(result);
    } 
    else { 
      failure(result);
    } 
  } 
   
  private BroadcastReceiver onBroadcast=new BroadcastReceiver() {
    @Override 
    public void onReceive(Context ctxt, Intent i) { 
      handleResult(i); 
    }