Back to project page ExpertAndroid.
The source code is released under:
MIT License
If you think the Android project ExpertAndroid listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.iuriio.demos.expertandroid.ch13parsesimple; //www . j av a 2s . c om import android.app.AlertDialog; import android.app.ProgressDialog; import android.content.DialogInterface; import android.content.Intent; import android.support.v7.app.ActionBarActivity; import android.util.Log; import android.widget.Toast; /** * Created by iuriio on 10/30/13. */ public abstract class BaseActivity extends ActionBarActivity { private static String TAG = null; private ProgressDialog pd = null; public BaseActivity(String tag) { TAG = tag; } public void reportBack(String message) { this.reportBack(TAG, message); } public void reportBack(String tag, String message) { Log.d(tag, message); } public void reportTransient(String message) { this.reportTransient(TAG, message); } public void reportTransient(String tag, String message) { String s = tag + ":" + message; Toast toast = Toast.makeText(this, s, Toast.LENGTH_SHORT); toast.show(); this.reportBack(tag, message); } public boolean invalidString(String s) { return StringUtils.invalidString(s); } public boolean validString(String s) { return StringUtils.validString(s); } public void gotoActivity(Class activityClassReference) { final Intent i = new Intent(this, activityClassReference); this.startActivity(i); } public void turnOnProgressDialog(String title, String message) { this.pd = ProgressDialog.show(this, title, message); } public void turnOffProgressDialog() { this.pd.cancel(); } public void alert(String title, String message) { AlertDialog alertDialog = new AlertDialog.Builder(this).create(); alertDialog.setTitle(title); alertDialog.setMessage(message); alertDialog.setButton(DialogInterface.BUTTON_POSITIVE, "OK", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { } }); alertDialog.show(); } public boolean validateForm() { return true; } }