Java Code Examples for com.loopj.android.http.PersistentCookieStore#clear()

The following examples show how to use com.loopj.android.http.PersistentCookieStore#clear() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MainActivity.java    From WeCenterMobile-Android with GNU General Public License v2.0 6 votes vote down vote up
@Override
public boolean onOptionsItemSelected(MenuItem item) {
	// Handle action bar item clicks here. The action bar will
	// automatically handle clicks on the Home/Up button, so long
	// as you specify a parent activity in AndroidManifest.xml.
	int id = item.getItemId();
	// �û�������ť
	if (id == R.id.feedback) {
		FeedbackAgent agent = new FeedbackAgent(MainActivity.this);
		agent.startFeedbackActivity();
	}
	if (id == R.id.logout) {
		sharedPreferences.clear();
		PersistentCookieStore cookieStore = new PersistentCookieStore(
				MainActivity.this);
		cookieStore.clear();
		Intent intent = new Intent(this, MainActivity.class);
		intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
		startActivity(intent);
		return true;
	}
	return super.onOptionsItemSelected(item);
}
 
Example 2
Source File: UserInfoShowActivity.java    From WeCenterMobile-Android with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void onClick(View v) {
	// TODO Auto-generated method stub
	switch (v.getId()) {
	case R.id.ll_logout:
		// �˳���¼
		sharedPreferences = new FanfanSharedPreferences(
				UserInfoShowActivity.this);
		sharedPreferences.clear();
		PersistentCookieStore cookieStore = new PersistentCookieStore(
				UserInfoShowActivity.this);
		cookieStore.clear();
		Intent mainIntent = new Intent(this, MainActivity.class);
		mainIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
		startActivity(mainIntent);
		break;
	case R.id.lv_topics:
		Intent intent = new Intent(UserInfoShowActivity.this,
				TopicFragmentActivity.class);
		intent.putExtra("uid", uid);
		startActivity(intent);
		break;
	case R.id.lv_focusi_person:
		Intent intent2 = new Intent(UserInfoShowActivity.this,
				AttentionUserActivity.class);
		intent2.putExtra("userorme", GlobalVariables.ATTENEION_ME);
		intent2.putExtra("uid", uid);
		startActivity(intent2);
		break;
	case R.id.lv_ifocus_person:
		Intent intent1 = new Intent(UserInfoShowActivity.this,
				AttentionUserActivity.class);
		intent1.putExtra("uid", uid);
		intent1.putExtra("userorme", GlobalVariables.ATTENTION_USER);
		startActivity(intent1);
		break;
	case R.id.lv_articles:
		Intent intent3 = new Intent(UserInfoShowActivity.this,
				ArticleActivity.class);
		intent3.putExtra("isArticle", GlobalVariables.ARTICLE);
		intent3.putExtra("uid", uid);
		startActivity(intent3);
		break;
	case R.id.lv_asks:
		Intent intent4 = new Intent(UserInfoShowActivity.this,
				ArticleActivity.class);
		intent4.putExtra("isArticle", GlobalVariables.QUESTION);
		intent4.putExtra("uid", uid);
		startActivity(intent4);
		break;
	case R.id.lv_news:
		Toast.makeText(UserInfoShowActivity.this, "lv_news",
				Toast.LENGTH_SHORT).show();
		break;
	case R.id.lv_search_friens:
		Toast.makeText(UserInfoShowActivity.this, "lv_search_friens",
				Toast.LENGTH_SHORT).show();
		break;
	case R.id.lv_replys:
		Intent intent5 = new Intent(UserInfoShowActivity.this,
				MyAnswerActivity.class);
		intent5.putExtra("uid", uid);
		startActivity(intent5);
		break;
	case R.id.bt_focus:
		if (haveFrocus == YES) {
			haveFrocus = NO;
			bt_focus.setBackgroundResource(R.drawable.btn_green_normal);
			bt_focus.setTextColor(android.graphics.Color.WHITE);
			bt_focus.setText("��ע");
		} else {
			haveFrocus = YES;
			bt_focus.setBackgroundResource(R.drawable.btn_silver_normal);
			bt_focus.setTextColor(android.graphics.Color.BLACK);
			bt_focus.setText("ȡ����ע");
		}
		pb_change_follow.setVisibility(View.VISIBLE);
		changeFrocusStatus();
		bt_focus.setClickable(false);
		break;
	default:
		break;
	}
}
 
Example 3
Source File: V2EX.java    From v2ex-daily-android with Apache License 2.0 4 votes vote down vote up
public static void logout(Context context){
    PersistentCookieStore cookieStore = new PersistentCookieStore(context);
    cookieStore.clear();
}