Question: ```
private void handleResponse(JSONObject serverResponse) {
    int success = 0;
    try {
        success = serverResponse.getInt(Responce.TAG_SUCCESS);
        if (success == 1) {
            progressDialog.dismiss();
            //after login we want to store user's id into shared preferences
            SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
            SharedPreferences.Editor editor = sharedPreferences.edit();
            editor.putString("cust_id", serverResponse.getString("CustomerId"));
            editor.commit();
            Toast.makeText(LoginActivity.this, serverResponse.getString((Responce.TAG_MESSAGE)), Toast.LENGTH_LONG).show();
            Intent intent = new Intent(LoginActivity.this,ProfileActivity.class);
            startActivity(intent);
        } else {
            progressDialog.dismiss();
            Toast.makeText(LoginActivity.this, serverResponse.getString(Responce.TAG_MESSAGE), Toast.LENGTH_LONG).show();
        }
    } catch (JSONException e) {
    }

}

```

First my splash Activity Launch and then Login Activity Open. 
After Login my Profile Activity Open.
I Want open Profile Activity Directly if user login one time and key/value stored.
Above Code for Login activity to use SharedPreferences . and am getting key/value form Response.
Please Tell me how to implement only one time login activity. 

`final SharedPreferences mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
 String value = (mSharedPreferences.getString("cust_id", "Default_value"));`

This is my key/value get in Profile Activity

Answer: 
use `'.{20}'`

```
In [15]: x = 'a'  * 30 + '.' * 20 + 'b' * 30
In [16]: m = re.search('.{20}', x)
In [17]: m
Out[17]: <_sre.SRE_Match at 0x103ec3850>

```
```
print '.'*20

```

Searching in internet should solve your problem before posting that...