Java Code Examples for com.gizwits.opensource.appkit.DeviceModule.GosDeviceListActivity

The following examples show how to use com.gizwits.opensource.appkit.DeviceModule.GosDeviceListActivity. These examples are extracted from open source projects. 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 Project: GOpenSource_AppKit_Android_AS   Source File: GosUserManager.java    License: MIT License 6 votes vote down vote up
private void logoutToClean() {
	GosPushManager.pushUnBindService(spf.getString("Token", ""));
	spf.edit().putString("UserName", "").commit();
	isclean = true;
	spf.edit().putString("PassWord", "").commit();
	spf.edit().putString("Uid", "").commit();
	spf.edit().putString("Token", "").commit();

	spf.edit().putString("thirdUid", "").commit();

	if (GosDeviceListActivity.loginStatus == 1) {
		GosDeviceListActivity.loginStatus = 0;
	} else {
		GosDeviceListActivity.loginStatus = 4;
	}

}
 
Example 2
/** 注销函数 */
void logoutToClean() {
	spf.edit().putString("UserName", "").commit();
	spf.edit().putString("PassWord", "").commit();
	spf.edit().putString("Uid", "").commit();
	spf.edit().putString("thirdUid", "").commit();

	spf.edit().putString("Token", "").commit();

	if (GosDeviceListActivity.loginStatus == 1) {
		GosDeviceListActivity.loginStatus = 0;
	} else {
		GosDeviceListActivity.loginStatus = 4;
	}

}
 
Example 3
/**
 * 用户登录回调
 */
@Override
protected void didUserLogin(GizWifiErrorCode result, String uid, String token) {

	progressDialog.cancel();
	Log.i("Apptest", GosDeviceListActivity.loginStatus + "\t" + "User");
	if (GosDeviceListActivity.loginStatus == 4 || GosDeviceListActivity.loginStatus == 3) {
		return;
	}
	Log.i("Apptest", GosDeviceListActivity.loginStatus + "\t" + "UserLogin");

	if (GizWifiErrorCode.GIZ_SDK_SUCCESS != result) {// 登录失败
		Toast.makeText(GosUserLoginActivity.this, toastError(result), toastTime).show();

	} else {// 登录成功

		GosDeviceListActivity.loginStatus = 1;
		Toast.makeText(GosUserLoginActivity.this, R.string.toast_login_successful, toastTime).show();

		// TODO 绑定推送
		GosPushManager.pushBindService(token);

		if (!TextUtils.isEmpty(etName.getText().toString()) && !TextUtils.isEmpty(etPsw.getText().toString())
				&& TextUtils.isEmpty(spf.getString("thirdUid", ""))) {
			spf.edit().putString("UserName", etName.getText().toString()).commit();
			spf.edit().putString("PassWord", etPsw.getText().toString()).commit();
		}
		spf.edit().putString("Uid", uid).commit();
		spf.edit().putString("Token", token).commit();

		intent = new Intent(GosUserLoginActivity.this, GosMainActivity.class);
		intent.putExtra("ThredLogin", true);
		startActivity(intent);

	}
}
 
Example 4
Source Project: Gizwits-SmartBuld_Android   Source File: GosUserLoginActivity.java    License: MIT License 5 votes vote down vote up
/**
 * 用户登录回调
 */
@Override
protected void didUserLogin(GizWifiErrorCode result, String uid, String token) {

	progressDialog.cancel();
	Log.i("Apptest", GosDeviceListActivity.loginStatus + "\t" + "User");
	if (GosDeviceListActivity.loginStatus == 4 || GosDeviceListActivity.loginStatus == 3) {
		return;
	}
	Log.i("Apptest", GosDeviceListActivity.loginStatus + "\t" + "UserLogin");

	if (GizWifiErrorCode.GIZ_SDK_SUCCESS != result) {// 登录失败
		Toast.makeText(GosUserLoginActivity.this, toastError(result), 2000).show();

	} else {// 登录成功

		GosDeviceListActivity.loginStatus = 1;
		Toast.makeText(GosUserLoginActivity.this, R.string.toast_login_successful, 2000).show();

		// TODO 绑定推送
		GosPushManager.pushBindService(token);

		if (!TextUtils.isEmpty(etName.getText().toString()) && !TextUtils.isEmpty(etPsw.getText().toString())) {
			spf.edit().putString("UserName", etName.getText().toString()).commit();
			spf.edit().putString("PassWord", etPsw.getText().toString()).commit();
		}
		spf.edit().putString("Uid", uid).commit();
		spf.edit().putString("Token", token).commit();

		intent = new Intent(GosUserLoginActivity.this, GosDeviceListActivity.class);
		intent.putExtra("ThredLogin", true);
		startActivity(intent);
	}
}
 
Example 5
Source Project: gokit-android   Source File: GosUserLoginActivity.java    License: MIT License 5 votes vote down vote up
/**
 * 用户登录回调
 */
@Override
protected void didUserLogin(GizWifiErrorCode result, String uid, String token) {

	progressDialog.cancel();
	Log.i("Apptest", GosDeviceListActivity.loginStatus + "\t" + "User");
	if (GosDeviceListActivity.loginStatus == 4 || GosDeviceListActivity.loginStatus == 3) {
		return;
	}
	Log.i("Apptest", GosDeviceListActivity.loginStatus + "\t" + "UserLogin");

	if (GizWifiErrorCode.GIZ_SDK_SUCCESS != result) {// 登录失败
		Toast.makeText(GosUserLoginActivity.this, toastError(result), toastTime).show();

	} else {// 登录成功

		GosDeviceListActivity.loginStatus = 1;
		Toast.makeText(GosUserLoginActivity.this, R.string.toast_login_successful, toastTime).show();

		// TODO 绑定推送
		GosPushManager.pushBindService(token);

		if (!TextUtils.isEmpty(etName.getText().toString()) && !TextUtils.isEmpty(etPsw.getText().toString())) {
			spf.edit().putString("UserName", etName.getText().toString()).commit();
			spf.edit().putString("PassWord", etPsw.getText().toString()).commit();
		}
		spf.edit().putString("Uid", uid).commit();
		spf.edit().putString("Token", token).commit();

		intent = new Intent(GosUserLoginActivity.this, GosDeviceListActivity.class);
		intent.putExtra("ThredLogin", true);
		startActivity(intent);

	}
}
 
Example 6
Source Project: Gizwits-SmartBuld_Android   Source File: GosDeviceMoreActivity.java    License: MIT License 4 votes vote down vote up
private void backToDeviceList() {
	Intent intent = new Intent(this, GosDeviceListActivity.class);
	// 关闭在GosDeviceListActivity后面所有打开的Activity
	intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
	startActivity(intent);
}
 
Example 7
private void backToDeviceList() {
	Intent intent = new Intent(this, GosDeviceListActivity.class);
	intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
	startActivity(intent);
}