If you think the Android project twitt4droid listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
/*
* Copyright 2014 Daniel Pedraza-Arcega/*www.java2s.com*/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/package com.twitt4droid.app.activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import com.twitt4droid.Twitt4droid;
import com.twitt4droid.activity.WebLoginActivity;
import com.twitt4droid.app.R;
publicclass SignInActivity extends ActionBarActivity {
@Override
protectedvoid onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (!Twitt4droid.isUserLoggedIn(this)) {
setContentView(R.layout.activity_sign_in);
}
}
@Override
protectedvoid onResume() {
super.onResume();
if (Twitt4droid.isUserLoggedIn(this)) {
goToMainActivity();
}
}
@Override
protectedvoid onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch (requestCode) {
case WebLoginActivity.REQUEST_CODE:
switch (resultCode) {
case RESULT_OK:
goToMainActivity();
break;
case RESULT_CANCELED: break;
}
break;
}
}
privatevoid goToMainActivity() {
Intent i = new Intent(this, MainActivity.class);
startActivity(i);
finish();
}
}