Show progress bar in ActionBar while loading cached CA certificates
This commit is contained in:
@@ -24,6 +24,7 @@ import android.app.Activity;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.net.VpnService;
|
import android.net.VpnService;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.view.Window;
|
||||||
|
|
||||||
public class MainActivity extends Activity
|
public class MainActivity extends Activity
|
||||||
{
|
{
|
||||||
@@ -31,6 +32,7 @@ public class MainActivity extends Activity
|
|||||||
public void onCreate(Bundle savedInstanceState)
|
public void onCreate(Bundle savedInstanceState)
|
||||||
{
|
{
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
|
||||||
setContentView(R.layout.main);
|
setContentView(R.layout.main);
|
||||||
startVpnService();
|
startVpnService();
|
||||||
|
|
||||||
@@ -38,11 +40,19 @@ public class MainActivity extends Activity
|
|||||||
bar.setDisplayShowTitleEnabled(false);
|
bar.setDisplayShowTitleEnabled(false);
|
||||||
|
|
||||||
/* load CA certificates in a background thread */
|
/* load CA certificates in a background thread */
|
||||||
|
setProgressBarIndeterminateVisibility(true);
|
||||||
new Thread(new Runnable() {
|
new Thread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
TrustedCertificateManager.getInstance().load();
|
TrustedCertificateManager.getInstance().load();
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run()
|
||||||
|
{
|
||||||
|
setProgressBarIndeterminateVisibility(false);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user