Example usage for android.os Bundle getString

List of usage examples for android.os Bundle getString

Introduction

In this page you can find the example usage for android.os Bundle getString.

Prototype

@Nullable
public String getString(@Nullable String key) 

Source Link

Document

Returns the value associated with the given key, or null if no mapping of the desired type exists for the given key or a null value is explicitly associated with the key.

Usage

From source file:com.pixmob.r2droid.SelectAccountActivity.java

@Override
protected void onRestoreInstanceState(Bundle savedInstanceState) {
    super.onRestoreInstanceState(savedInstanceState);
    selectedAccount = savedInstanceState.getString(STATE_SELECTED_ACCOUNT);
}

From source file:net.idlesoft.android.apps.github.activities.Dashboard.java

@Override
protected void onRestoreInstanceState(final Bundle savedInstanceState) {
    final TextView postTitle = (TextView) findViewById(R.id.tv_dashboard_latestPost_title);
    final TextView postLink = (TextView) findViewById(R.id.tv_dashboard_latestPost_link);

    postTitle.setText(savedInstanceState.getString("postTitle"));
    postLink.setText(savedInstanceState.getString("postLink"));

    super.onRestoreInstanceState(savedInstanceState);
}

From source file:com.sawyer.advadapters.app.adapters.jsonadapter.JSONAdapterFragment.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    if (savedInstanceState != null) {
        mCheckedCount = savedInstanceState.getInt(STATE_CAB_CHECKED_COUNT);
        try {/*  ww w .j a v a  2 s.  c  om*/
            JSONArray list = new JSONArray(savedInstanceState.getString(STATE_LIST));
            setListAdapter(new MovieJSONAdapter(getActivity(), list));
        } catch (JSONException e) {
            Log.e(JSONAdapterFragment.class.getSimpleName(), "OnRestore Error", e);
            mCheckedCount = 0;
            setListAdapter(new MovieJSONAdapter(getActivity()));
        }
    } else {
        setListAdapter(new MovieJSONAdapter(getActivity()));
    }
}

From source file:com.sawyer.advadapters.app.adapters.jsonadapter.UnitTestJSONArrayFragment.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    if (savedInstanceState != null) {
        mCheckedCount = savedInstanceState.getInt(STATE_CAB_CHECKED_COUNT);
        try {/*from   w ww .  ja va 2 s  .c  o  m*/
            JSONArray list = new JSONArray(savedInstanceState.getString(STATE_LIST));
            setListAdapter(new UnitTestMovieAdapter(getActivity(), list));
        } catch (JSONException e) {
            Log.w(UnitTestJSONArrayFragment.class.getSimpleName(), "Error restoring state", e);
            mCheckedCount = 0;
            setListAdapter(new UnitTestMovieAdapter(getActivity()));
        }
    } else {
        setListAdapter(new UnitTestMovieAdapter(getActivity()));
    }
}

From source file:org.maikelwever.droidpile.SendMailActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_send_mail);

    this.context = getApplicationContext();

    addressView = (ContactsCompletionView) findViewById(R.id.sendViewAdresses);
    ccView = (ContactsCompletionView) findViewById(R.id.sendViewCC);
    //bccView = (ContactsCompletionView) findViewById(R.id.sendViewBCC);
    //getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setTitle(R.string.title_activity_send_mail);

    String savedMid;/*from   w  ww .  j  a  v  a2s . c om*/
    try {
        Bundle bundle = getIntent().getExtras();
        savedMid = bundle.getString("draft-mid");
    } catch (Exception e) {
        savedMid = "";
    }

    if (!savedMid.isEmpty()) {
        progressDialog = ProgressDialog.show(SendMailActivity.this, "",
                getString(R.string.download_please_wait), true);
        new FetchDraft().execute(savedMid);
    }

    if (contacts == null) {
        new FetchContactsTask().execute("not needed?");
    }
}

From source file:com.mobilesolutionworks.android.httpcache.WorksHttpCacheService.java

protected void refreshData(Intent intent) {
    // rebuild into hierarchical uri
    String local = intent.getStringExtra("local");
    String remote = intent.getStringExtra("remote");

    if (mQueues.contains(local)) {
        return;//from ww w .j  av a 2  s. co m
    }

    mQueues.add(local);

    String _method = intent.getStringExtra("method");
    WorksHttpRequest.Method method = WorksHttpRequest.Method.GET;
    if ("POST".equals(_method)) {
        method = WorksHttpRequest.Method.POST;
    }

    WorksHttpRequest config = new WorksHttpRequest();
    config.method = method;
    config.url = remote;

    Bundle params = intent.getBundleExtra("params");
    if (params != null) {
        for (String key : params.keySet()) {
            String value = params.getString(key);
            if (!TextUtils.isEmpty(value)) {
                config.setPostParam(key, value);
            }
        }
    }

    int cache = intent.getIntExtra("cache", 0);
    if (cache == 0) {
        cache = 60;
    }

    cache *= 1000;

    int timeout = intent.getIntExtra("timeout", 0);
    if (timeout == 0) {
        timeout = 10;
    }
    timeout *= 1000;

    WorksHttpFutureTask<String> task = getSaveTask(local, cache, timeout);
    task.execute(config, mHandler, mExecutors);
}

From source file:com.facebook.android.Places.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    mHandler = new Handler();
    location = new JSONObject();

    setContentView(R.layout.places_list);

    Bundle extras = getIntent().getExtras();
    String default_or_new = extras.getString("LOCATION");
    if (default_or_new.equals("times_square")) {
        try {/*from  w  w  w  .j ava 2s  .  c o  m*/
            location.put("latitude", new Double(TIMES_SQUARE_LAT));
            location.put("longitude", new Double(TIMES_SQUARE_LON));
        } catch (JSONException e) {
        }
        fetchPlaces();
    } else {
        getLocation();
    }
}

From source file:com.tonikorin.cordova.plugin.LocationProvider.LocationService.java

@Override
protected void onHandleIntent(Intent intent) {
    try {//from   w  ww  .  j av a  2 s  . c  o m
        myContext = LocationService.this;
        // read the configuration
        if (this.config == null) {
            String jsonString = myContext.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE)
                    .getString(CONFIG_NAME, "{}");
            config = new JSONObject(jsonString);
        }
        // get the input message from intent
        Bundle extras = intent.getExtras();
        String msgJsonStr = extras.getString("data"); // own "data" property inside "data" property
        JSONObject messageIn = new JSONObject(msgJsonStr);
        String time = extras.getString("time", "");
        handleLocationQuery(messageIn, time);
    } catch (Exception e) {
        Log.e(TAG, "onHandleIntent exception ", e);
    }
}

From source file:com.odoo.base.addons.mail.widget.MailChatterCompose.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.base_mail_chatter_message_compose);
    getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
    getSupportActionBar().hide();/*from ww w . j av  a2s  .c o  m*/
    fileManager = new OFileManager(this);
    Bundle extra = getIntent().getExtras();
    mType = MessageType.valueOf(extra.getString("type"));
    mModel = OModel.get(this, extra.getString("model"), null);
    irAttachment = new IrAttachment(this, null);
    mailMessage = new MailMessage(this, null);
    server_id = extra.getInt("server_id");
    if (mModel.getModelName().equals("res.partner")) {
        partner_id = server_id;
    } else {
        ODataRow row = mModel.browse(mModel.selectRowId(server_id));
        for (OColumn col : mModel.getColumns(false)) {
            if (col.getType().isAssignableFrom(ResPartner.class)) {
                if (col.getRelationType() != null && col.getRelationType() == OColumn.RelationType.ManyToOne) {
                    ODataRow partner = null;
                    if (!row.getString(col.getName()).equals("false")) {
                        partner = row.getM2ORecord(col.getName()).browse();
                    }
                    if (partner != null && partner.getInt("id") != 0) {
                        partner_id = partner.getInt("id");
                    }
                }
            }
        }
    }
    findViewById(R.id.btnAttachment).setOnClickListener(this);
    findViewById(R.id.btnSend).setOnClickListener(this);
    findViewById(R.id.btnCancel).setOnClickListener(this);
    edtSubject = (EditText) findViewById(R.id.messageSubject);
    edtBody = (EditText) findViewById(R.id.messageBody);
    horizontalScrollView = (LinearLayout) findViewById(R.id.attachmentsList);
    init();
}

From source file:com.team1.soccerplayers.layout.PlayerInfoActivity.java

@Override
public void onRestoreInstanceState(Bundle savedInstanceState) {
    // Always call the superclass so it can restore the view hierarchy
    super.onRestoreInstanceState(savedInstanceState);
    playerName = savedInstanceState.getString(STATE_PLAYER);

    // Restore state members from saved instance

}