If you think the Android project RateBeer-Mobile 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 2010, Jesper Fussing Mrk//www.java2s.com
*
* This file is part of Ratebeer Mobile for Android.
*
* Ratebeer Mobile is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Ratebeer Mobile is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Ratebeer Mobile. If not, see <http://www.gnu.org/licenses/>.
*/package dk.moerks.ratebeermobile.activity;
import android.app.ListActivity;
import android.content.res.Configuration;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.Window;
import android.widget.Toast;
publicclass RBActivity extends ListActivity {
privatestaticfinal String LOGTAG = "RBActivity";
privatestaticboolean inProgress = false;
privatestatic String userId = "";
publicfinal Handler threadHandler = new Handler();
publicfinal Runnable update = new Runnable() {
publicvoid run() {
update();
}
};
@Override
publicvoid onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Request progress bar
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
}
@Override
publicvoid onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
Log.d(LOGTAG, "CONFIGURATION CHANGED (Orientation)");
}
publicvoid indeterminateStart(String progressMessage){
setTitle(progressMessage);
setProgressBarIndeterminateVisibility(true);
setInProgress(true);
}
publicvoid indeterminateStop(){
setTitle("RateBeer Mobile");
setProgressBarIndeterminateVisibility(false);
setInProgress(false);
}
publicvoid alertUser(String message){
//Looper.prepare();
Toast toast = Toast.makeText(getApplicationContext(), message, Toast.LENGTH_LONG);
toast.show();
//threadHandler.post(update);
//Looper.loop();
}
protectedvoid update(){
indeterminateStop();
}
//Accessors
publicstaticvoid setInProgress(boolean inProgress) {
RBActivity.inProgress = inProgress;
}
publicstaticboolean isInProgress() {
return inProgress;
}
publicstaticvoid setUserId(String userId) {
RBActivity.userId = userId;
}
publicstatic String getUserId() {
return userId;
}
}