| 38 | import java.nio.charset.StandardCharsets; |
| 39 | |
| 40 | public class ActivityDSN extends ActivityBase { |
| 41 | private TextView tvHeaders; |
| 42 | private ContentLoadingProgressBar pbWait; |
| 43 | private Group grpReady; |
| 44 | |
| 45 | @Override |
| 46 | protected void onCreate(Bundle savedInstanceState) { |
| 47 | super.onCreate(savedInstanceState); |
| 48 | |
| 49 | View view = LayoutInflater.from(this).inflate(R.layout.activity_dsn, null); |
| 50 | setContentView(view); |
| 51 | |
| 52 | getSupportActionBar().setDisplayHomeAsUpEnabled(true); |
| 53 | getSupportActionBar().setSubtitle("DSN"); |
| 54 | |
| 55 | tvHeaders = findViewById(R.id.tvHeaders); |
| 56 | pbWait = findViewById(R.id.pbWait); |
| 57 | grpReady = findViewById(R.id.grpReady); |
| 58 | |
| 59 | // Initialize |
| 60 | grpReady.setVisibility(View.GONE); |
| 61 | |
| 62 | load(); |
| 63 | } |
| 64 | |
| 65 | @Override |
| 66 | protected void onNewIntent(Intent intent) { |
| 67 | super.onNewIntent(intent); |
| 68 | setIntent(intent); |
| 69 | load(); |
| 70 | } |
| 71 | |
| 72 | @Override |
| 73 | public boolean onOptionsItemSelected(MenuItem item) { |
| 74 | int itemId = item.getItemId(); |
| 75 | if (itemId == android.R.id.home) { |
| 76 | finish(); |
| 77 | return true; |
| 78 | } |
| 79 | return super.onOptionsItemSelected(item); |
| 80 | } |
| 81 | |
| 82 | private void load() { |
| 83 | Uri uri = getIntent().getData(); |
| 84 | Log.i("DSN uri=" + uri); |
| 85 | |
| 86 | Bundle args = new Bundle(); |
| 87 | args.putParcelable("uri", uri); |
| 88 | |
| 89 | new SimpleTask<Spanned>() { |
| 90 | @Override |
| 91 | protected void onPreExecute(Bundle args) { |
| 92 | pbWait.setVisibility(View.VISIBLE); |
| 93 | } |
| 94 | |
| 95 | @Override |
| 96 | protected void onPostExecute(Bundle args) { |
| 97 | pbWait.setVisibility(View.GONE); |
nothing calls this directly
no outgoing calls
no test coverage detected