use runOnUiThread in autofill preferences activity
This commit is contained in:
parent
a49399ab54
commit
7da9633a3c
1 changed files with 15 additions and 8 deletions
|
@ -74,7 +74,11 @@ public class AutofillPreferenceActivity extends AppCompatActivity {
|
||||||
private class populateTask extends AsyncTask<Void, Void, Void> {
|
private class populateTask extends AsyncTask<Void, Void, Void> {
|
||||||
@Override
|
@Override
|
||||||
protected void onPreExecute() {
|
protected void onPreExecute() {
|
||||||
findViewById(R.id.progress_bar).setVisibility(View.VISIBLE);
|
runOnUiThread(new Runnable() {
|
||||||
|
public void run() {
|
||||||
|
findViewById(R.id.progress_bar).setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -105,13 +109,16 @@ public class AutofillPreferenceActivity extends AppCompatActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPostExecute(Void aVoid) {
|
protected void onPostExecute(Void aVoid) {
|
||||||
findViewById(R.id.progress_bar).setVisibility(View.GONE);
|
runOnUiThread(new Runnable() {
|
||||||
|
public void run() {
|
||||||
recyclerView.setAdapter(recyclerAdapter);
|
findViewById(R.id.progress_bar).setVisibility(View.GONE);
|
||||||
Bundle extras = getIntent().getExtras();
|
recyclerView.setAdapter(recyclerAdapter);
|
||||||
if (extras != null) {
|
Bundle extras = getIntent().getExtras();
|
||||||
recyclerView.scrollToPosition(recyclerAdapter.getPosition(extras.getString("appName")));
|
if (extras != null) {
|
||||||
}
|
recyclerView.scrollToPosition(recyclerAdapter.getPosition(extras.getString("appName")));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue