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.gb.cwsup.activity.CarAddActivity.java

private void intentisupdate() {
    Intent intent = getIntent();
    TYPE = intent.getStringExtra("type");
    if (!TextUtils.isEmpty(TYPE)) {
        if (TYPE.equals("UPDATE")) {
            car = (CarBean) intent.getSerializableExtra("CAR");
        } else {//from  w  w w . j av  a2s .  c  o  m
            return;
        }
        if (car != null) {
            no.setText(car.getCarno());
            color.setText(car.getColor());
            type.setText(car.getType());
            typemobels.setText(car.getTypemodels());
            isdefauls.setSelected(car.isDefault());
        }
    }
}

From source file:com.example.activity.FollowersActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.followers_list);

    Intent intent = getIntent();
    playerId = intent.getIntExtra(PLAYER_ID, 1);
    playerName = intent.getStringExtra(PLAYER_NAME);

    title = (TextView) findViewById(R.id.topview_title);
    back = (ImageView) findViewById(R.id.topview_back);
    title.setText(playerName + "?");
    back.setVisibility(View.VISIBLE);
    back.setOnClickListener(new OnClickListener() {

        @Override//www . ja  va 2  s  .c o  m
        public void onClick(View v) {
            // TODO Auto-generated method stub
            finish();
        }
    });

    xlistView = (XListView) findViewById(R.id.followers_listview);

    xlistView.setXListViewListener(this, 0);
    xlistView.setPullLoadEnable(true);
    xlistView.setRefreshTime();

    followersModel = new FollowersModel(this);
    followersModel.addResponseListener(this);
    followersModel.getFollowers(playerId);

}

From source file:com.eyc.statusBarNotification.StatusBarNotification.java

/**
 * Called when a notification is clicked.
 * @param intent The new Intent passed from the notification.
 *//*from  w ww  .  j av  a2s. c  o  m*/
@Override
public void onNewIntent(Intent intent) {
    // The incoming Intent may or may not have been for a notification.
    String tag = intent.getStringExtra("notificationTag");
    if (tag != null) {
        this.webView.sendJavascript("window.Notification.callOnclickByTag('" + tag + "')");
    }
}

From source file:com.may.ple.parking.gateway.activity.GateOutActivity.java

protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (requestCode == 1) {
        if (resultCode == RESULT_OK) {
            String licenseNo = data.getStringExtra("result");

            VehicleCheckOutCriteriaReq req = new VehicleCheckOutCriteriaReq();
            req.licenseNo = licenseNo;/* www  .ja v  a  2 s .  co  m*/
            req.reasonNoScan = reasonNoScan;
            req.deviceId = ApplicationScope.getInstance().deviceId;
            req.gateName = gateName;

            service.passedParam = req;
            service.send(1, req, VehicleCheckOutCriteriaResp.class, "/restAct/vehicle/checkOutVehicle",
                    HttpMethod.POST);
            spinner.show();
        }
    }
}

From source file:com.dmbstream.android.activity.SearchResultsActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    Intent intent = getIntent();

    if (Intent.ACTION_SEARCH.equals(intent.getAction())) {
        query = intent.getStringExtra(SearchManager.QUERY);
    } else {/*from   w  w w .j  ava2  s . c  o  m*/
        query = intent.getStringExtra(Constants.EXTRA_QUERY_TERM);
        Log.d(TAG, "Query from other intent: " + query);
    }

    // After setting up variables so that they can be accessed in getApiUrl
    // which is called at the end of super.onCreate
    super.onCreate(savedInstanceState);

    // Push the search box into the layout group below the logo bar and above
    // the 'search results' title bar
    ViewGroup container = (ViewGroup) findViewById(R.id.TitleGroup);
    container.addView(ViewGroup.inflate(this, R.layout.partial_search_box, null), 0);
    searchBox = (EditText) findViewById(R.id.SearchText);
    searchBox.setText(query);
    searchBox.setOnKeyListener(this);
    ImageButton searchButton = (ImageButton) findViewById(R.id.search_go_button);
    searchButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            AnalyticsUtil.trackEvent(SearchResultsActivity.this, "SearchResults", "Click", "Search", 0);
            search();
        }
    });

    inputMethodManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
    if (inputMethodManager != null) {
        inputMethodManager.hideSoftInputFromWindow(searchBox.getWindowToken(),
                InputMethodManager.HIDE_NOT_ALWAYS);
    }
}

From source file:de.petendi.ethereum.android.EthereumAndroid.java

private void handleResponse(Intent reponse) {
    int id = reponse.getIntExtra(ID, 0);
    String error = reponse.getStringExtra(EXTRA_ERROR);
    byte[] response = reponse.getByteArrayExtra(EXTRA_DATA);
    if (error != null) {
        try {/* ww w. j  a va  2  s  .  c om*/
            ServiceError errorObj = objectMapper.readValue(error, ServiceError.class);
            callback.handleError(id, errorObj);
        } catch (IOException e) {
            throw new IllegalArgumentException(e);
        }
    } else if (response != null) {
        try {
            WrappedResponse responseObj = objectMapper.readValue(response, WrappedResponse.class);
            callback.handleResponse(id, responseObj);
        } catch (IOException e) {
            throw new IllegalArgumentException(e);
        }
    }
}

From source file:com.plugin.cordova.StatusBarNotification.java

/**
 * Called when a notification is clicked.
 * @param intent The new Intent passed from the notification.
 *///  w w  w . j av a2 s.  c om
@Override
public void onNewIntent(Intent intent) {
    // The incoming Intent may or may not have been for a notification.
    String tag = intent.getStringExtra("notificationTag");
    if (tag != null) {
        sendJavascript("window.Notification.callOnclickByTag('" + tag + "')");
    }
}

From source file:com.synvata.modules.DriverLicenseEditActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.modules_edit_driverlicense_activity);
    Intent intent = this.getIntent();
    String data = intent.getStringExtra("data");
    try {//  w ww .  ja  va2 s  .c  om
        JSONObject json = new JSONObject(data);
        initView(json);
    } catch (JSONException e) {
        log(e);
    }

}

From source file:dk.dtu.imm.datacollector.MainPipeline.java

@Override
protected void onHandleIntent(Intent intent) {
    if (ACTION_RUN_ONCE.equals(intent.getAction())) {
        String probeName = intent.getStringExtra(RUN_ONCE_PROBE_NAME);
        runProbeOnceNow(probeName);//from   ww  w  .  ja va2  s . c  o  m
    } else {
        super.onHandleIntent(intent);
    }
}

From source file:uk.co.md87.android.sensorlogger.UploaderService.java

@Override
public void onStart(Intent intent, int startId) {
    super.onStart(intent, startId);

    headers.clear();/* ww  w.  jav a2  s .c o  m*/
    for (String key : intent.getExtras().keySet()) {
        headers.put(key, intent.getStringExtra(key));
    }
}