Example usage for android.content Intent getStringExtra

List of usage examples for android.content Intent getStringExtra

Introduction

In this page you can find the example usage for android.content Intent getStringExtra.

Prototype

public String getStringExtra(String name) 

Source Link

Document

Retrieve extended data from the intent.

Usage

From source file:com.example.ridemepassenger.MainActivity.java

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    // ??????  //from  w w  w. jav a 2s.c  om
    switch (requestCode) {
    case CODE_START:
        startLocation = data.getStringExtra(InputStartActivity.START);
        mStartEdit.setText(startLocation);
        break;
    case CODE_END:
        destination = data.getStringExtra(InputDestActivity.DEST);
        mEndEdit.setText(destination);
        break;
    default:
        break;
    }
}

From source file:net.evecom.androidecssp.activity.event.EventAddActivity.java

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    switch (requestCode) {
    case 1: // 
        String filePath = data.getStringExtra("filePath");
        // manageFileDataAndListView(filePath);
        break;//from  w  w  w  .  j a  va 2  s .co  m
    case R.layout.afnail_picture_activity: //   

        break;
    case 3: // 

        break;
    case R.layout.picture_select_at: // 
        new Thread(new Runnable() {
            @Override
            public void run() {
                filebeans.removeAll(filebeans);
                filebeans = getDb().findAll(FileManageBean.class);
                Message message = new Message();
                message.what = R.layout.picture_select_at;
                pubHandler.sendMessage(message);
            }
        }).start();
        break;
    case R.layout.event_name_add_activity: // 
        BaseModel eventinfo = (BaseModel) getData("eventinfo", data);
        if (null != eventinfo) {
            nameTV.setText(eventinfo.getStr("eventname"));
            addrTV.setText(eventinfo.getStr("happenaddress"));
            bgrTV.setText(eventinfo.getStr("reporterperson") + "-" + eventinfo.getStr("reportertel"));
            contentTV.setText(eventinfo.getStr("eventcontent"));
        }
        break;
    case R.layout.tree_list_at: // 
        /* eventTypeid = data.getStringExtra("eventTypeid");
        eventTypeName = data.getStringExtra("eventTypeName");
        clztTV.setText(eventTypeName);*/
        eventTypeid = data.getStringExtra("nodeid");
        eventTypeName = data.getStringExtra("nodeName");
        clztTV.setText(eventTypeName);
        break;
    default:
        break;
    }
    super.onActivityResult(requestCode, resultCode, data);
}

From source file:com.ec.android.module.bluetooth40.base.BaseBluetoothControlWithProtocolActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ////from   w  ww.  j  ava 2  s  .  c  om
    mLocalBroadcastManager = LocalBroadcastManager.getInstance(getApplicationContext());
    //
    final Intent intent = getIntent();
    mDeviceName = intent.getStringExtra(EXTRAS_DEVICE_NAME);
    mNickName = intent.getStringExtra(EXTRAS_DEVICE_NICK_NAME);
    mDeviceAddress = intent.getStringExtra(EXTRAS_DEVICE_ADDRESS);

    //
    Intent gattServiceIntent = new Intent(this, BluetoothLeService.class);
    bindService(gattServiceIntent, mServiceConnection, BIND_AUTO_CREATE);
    initFuture();
}

From source file:io.v.android.apps.syncslides.SignInActivity.java

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    switch (requestCode) {
    case REQUEST_CODE_PICK_ACCOUNT: {
        if (resultCode != RESULT_OK) {
            Toast.makeText(this, "Must pick account", Toast.LENGTH_LONG).show();
            pickAccount();/*w  ww .  j a v  a  2s.  c o m*/
            break;
        }
        pickAccountDone(data.getStringExtra(AccountManager.KEY_ACCOUNT_NAME));
        break;
    }
    case REQUEST_CODE_FETCH_USER_PROFILE_APPROVAL:
        if (resultCode != RESULT_OK) {
            Log.e(TAG, "User didn't approve oauth2 request");
            break;
        }
        fetchUserProfile();
        break;
    }
}

From source file:com.joanzapata.PDFViewActivity.java

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    // TODO Auto-generated method stub

    if (requestCode == PICKFILE_REQUEST_CODE && resultCode == RESULT_OK) {
        String filePath = data.getStringExtra("GetPath");
        String fileName = data.getStringExtra("GetFileName");
        filePathDetails = filePath + "/" + fileName;
        openPDF(filePathDetails);/*from  w  ww. j  av  a 2s.co m*/
    }

}

From source file:com.safecell.ManageProfile_Activity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setWindowAnimations(R.anim.null_animation);

    Intent callingIntent = getIntent();
    callingActivity = callingIntent.getStringExtra("CallingActivity");

    context = ManageProfile_Activity.this;
    dialog = new ProgressDialog(context);
    licenseRepository = new LicenseRepository(context);
    intializesecondTitleLabelArray();//from w  w  w.  j a va2 s. c  om
    intiUI();

    progressDialog = new ProgressDialog(context);
    licenseProgressDialog = new ProgressDialog(context);
    licenseThread = new LicenseThread();

    handleMessageFromThread();

    setListAdapter(new manageProfileListAdapter(ManageProfile_Activity.this));
    TabControler tabControler = new TabControler(ManageProfile_Activity.this);
    homeButton.setOnClickListener(tabControler.getHomeTabOnClickListner());

}

From source file:cm.aptoide.pt.ManageRepo.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.repolist);//  w ww.  j a  v  a2s  .c om

    db = new DbHandler(this);

    Intent i = getIntent();
    if (i.hasExtra("empty")) {
        final String uri = i.getStringExtra("uri");
        AlertDialog alrt = new AlertDialog.Builder(this).create();
        alrt.setTitle(getString(R.string.title_repo_alrt));
        alrt.setIcon(android.R.drawable.ic_dialog_alert);
        alrt.setMessage(getString(R.string.myrepo_alrt) + uri);
        alrt.setButton("Yes", new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int which) {
                db.addServer(uri);
                change = true;
                redraw();
                return;
            }
        });
        alrt.setButton2("No", new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int which) {
                return;
            }
        });
        alrt.show();
    } else if (i.hasExtra("uri")) {
        String uri = i.getStringExtra("uri");
        Vector<String> new_serv_lst = getRemoteServLst(uri);
        for (final String srv : new_serv_lst) {
            AlertDialog alrt = new AlertDialog.Builder(this).create();
            alrt.setTitle(getString(R.string.title_repo_alrt));
            alrt.setIcon(android.R.drawable.ic_dialog_alert);
            alrt.setMessage(getString(R.string.newrepo_alrt) + srv);
            alrt.setButton("Yes", new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int which) {
                    db.addServer(srv);
                    change = true;
                    redraw();
                    return;
                }
            });
            alrt.setButton2("No", new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int which) {
                    return;
                }
            });
            alrt.show();
        }
    } else if (i.hasExtra("newrepo")) {
        final String repo = i.getStringExtra("newrepo");
        AlertDialog alrt = new AlertDialog.Builder(this).create();
        alrt.setTitle(getString(R.string.title_repo_alrt));
        alrt.setIcon(android.R.drawable.ic_dialog_alert);
        alrt.setMessage(getString(R.string.newrepo_alrt) + repo);
        alrt.setButton("Yes", new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int which) {
                db.addServer(repo);
                change = true;
                redraw();
                return;
            }
        });
        alrt.setButton2("No", new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int which) {
                //exit
            }
        });
        alrt.show();
    }
}

From source file:org.anhonesteffort.flock.SubscriptionGoogleFragment.java

private void handleItemPurchased(Intent data) {
    try {/*from www.  j  av  a 2  s. c o m*/

        String purchaseData = data.getStringExtra("INAPP_PURCHASE_DATA");
        JSONObject purchaseObject = new JSONObject(purchaseData);
        String productSku = purchaseObject.getString("productId");
        String purchaseToken = purchaseObject.getString("purchaseToken");

        if (productSku != null && purchaseToken != null) {
            GooglePlan newGooglePlan = new GooglePlan(subscriptionActivity.davAccount.getUserId(),
                    SKU_YEARLY_SUBSCRIPTION, PURCHASE_TOKEN_HACK, Long.MAX_VALUE);

            AccountStore.setSubscriptionPlan(subscriptionActivity, newGooglePlan);
            new AccountSyncScheduler(subscriptionActivity).requestSync();

            daysTillNextCharge = 365;
            Toast.makeText(subscriptionActivity, R.string.thanks, Toast.LENGTH_SHORT).show();
            handleUpdateUi();
            return;
        }

    } catch (JSONException e) {
        Log.e(TAG, "no :(", e);
    } catch (JsonProcessingException e) {
        ErrorToaster.handleShowError(subscriptionActivity, e);
    }

    Toast.makeText(subscriptionActivity, R.string.google_play_error_please_update_google_play_services,
            Toast.LENGTH_LONG).show();
}

From source file:com.lepin.activity.MyLoveCarActivity.java

protected void onActivityResult(int requestCode, int resultCode, Intent data) {

    if (resultCode == RESULT_OK && requestCode == 5) {
        String cartype = data.getStringExtra("cartype");
        carTypeId = String.valueOf(data.getIntExtra("typeId", 0));
        mlType.setText(cartype);/*from   ww  w . ja va  2 s.  c  om*/
    }
    if (resultCode == 10 && requestCode == 10) {
        loadCarInfo();
    }
}