Android Open Source - droidkit-engines Base Activity






From Project

Back to project page droidkit-engines.

License

The source code is released under:

MIT License

If you think the Android project droidkit-engines 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

package com.droidkit.sample;
/*from w w w.  j a  va 2 s. co  m*/
import android.app.ProgressDialog;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.support.v7.app.ActionBarActivity;
import android.text.TextUtils;

public class BaseActivity extends ActionBarActivity {

    protected static final Handler handler = new Handler(Looper.getMainLooper());

    protected final Object progressDialogSync = new Object();
    protected volatile ProgressDialog progressDialog;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ActivityHelper.tide(this);

        // ...
    }

    public void showProgressDialog(final String title, final String text) {
        runOnUiThread(new Runnable() {
            @Override
            public void run() {
                synchronized (progressDialogSync) {
                    if (progressDialog == null) {
                        progressDialog = new ProgressDialog(BaseActivity.this);
                        progressDialog.setIndeterminate(true);
                        progressDialog.setCancelable(true);
                    }
                    if (!TextUtils.isEmpty(title)) {
                        progressDialog.setTitle(title);
                    } else {
                        progressDialog.setTitle("");
                    }

                    if (!TextUtils.isEmpty(text)) {
                        progressDialog.setMessage(text);
                    } else {
                        progressDialog.setMessage("");
                    }
                    progressDialog.show();
                }
            }
        });
    }

    public void hideProgressDialog() {
        runOnUiThread(new Runnable() {
            @Override
            public void run() {
                if (progressDialog != null && progressDialog.isShowing()) {
                    try {
                        progressDialog.dismiss();
                    } catch (final IllegalArgumentException e) {
                        // Sometimes we may get "View not attached to window manager"
                        e.printStackTrace();
                    }
                }
            }
        });
    }

}




Java Source Code List

com.droidkit.engine.Engines.java
com.droidkit.engine.common.KeyCallback.java
com.droidkit.engine.common.ValueCallback.java
com.droidkit.engine.common.ValuesCallback.java
com.droidkit.engine.event.Events.java
com.droidkit.engine.event.NotificationCenter.java
com.droidkit.engine.event.NotificationListener.java
com.droidkit.engine.event.StateInitValue.java
com.droidkit.engine.event.State.java
com.droidkit.engine._internal.RunnableActor.java
com.droidkit.engine._internal.sqlite.AbstractDao.java
com.droidkit.engine._internal.sqlite.BinarySerializator.java
com.droidkit.engine._internal.sqlite.DbHelper.java
com.droidkit.engine._internal.sqlite.DbProvider.java
com.droidkit.engine._internal.sqlite.FastCursor.java
com.droidkit.engine._internal.sqlite.SqlStatements.java
com.droidkit.engine._internal.util.SortedArrayList.java
com.droidkit.engine._internal.util.Utils.java
com.droidkit.engine._internal.util.WeakEqualReference.java
com.droidkit.engine.keyvalue.DataAdapter.java
com.droidkit.engine.keyvalue.KeyValueEngine.java
com.droidkit.engine.keyvalue.StorageAdapter.java
com.droidkit.engine.keyvalue.sqlite.SQLiteStorageAdapter.java
com.droidkit.engine.keyvalue.sqlite.internal.KeyValueEngineDao.java
com.droidkit.engine.keyvalue.sqlite.internal.KeyValueEngineTableStatements.java
com.droidkit.engine.list.DataAdapter.java
com.droidkit.engine.list.ListEngine.java
com.droidkit.engine.list.StorageAdapter.java
com.droidkit.engine.list.sqlite.SQLiteMultipleStorageAdapter.java
com.droidkit.engine.list.sqlite.SQLiteStorageAdapter.java
com.droidkit.engine.list.sqlite.internal.ListEngineDao.java
com.droidkit.engine.list.sqlite.internal.ListEngineTableStatements.java
com.droidkit.sample.ActivityHelper.java
com.droidkit.sample.BaseActivity.java
com.droidkit.sample.TestMainActivity.java
com.droidkit.sample.listenginetest.TestListEngineActivity.java
com.droidkit.sample.listenginetest.TestProto.java
com.droidkit.sample.view.BlockingListView.java