| 56 | import java.util.Locale; |
| 57 | |
| 58 | public class ActivityDMARC extends ActivityBase { |
| 59 | private TextView tvDmarc; |
| 60 | private ContentLoadingProgressBar pbWait; |
| 61 | private Group grpReady; |
| 62 | |
| 63 | @Override |
| 64 | protected void onCreate(Bundle savedInstanceState) { |
| 65 | super.onCreate(savedInstanceState); |
| 66 | |
| 67 | View view = LayoutInflater.from(this).inflate(R.layout.activity_dmarc, null); |
| 68 | setContentView(view); |
| 69 | |
| 70 | getSupportActionBar().setDisplayHomeAsUpEnabled(true); |
| 71 | getSupportActionBar().setSubtitle(R.string.title_advanced_dmarc_viewer); |
| 72 | |
| 73 | tvDmarc = findViewById(R.id.tvDmarc); |
| 74 | pbWait = findViewById(R.id.pbWait); |
| 75 | grpReady = findViewById(R.id.grpReady); |
| 76 | |
| 77 | // Initialize |
| 78 | grpReady.setVisibility(View.GONE); |
| 79 | |
| 80 | load(); |
| 81 | } |
| 82 | |
| 83 | @Override |
| 84 | protected void onNewIntent(Intent intent) { |
| 85 | super.onNewIntent(intent); |
| 86 | setIntent(intent); |
| 87 | load(); |
| 88 | } |
| 89 | |
| 90 | @Override |
| 91 | public boolean onOptionsItemSelected(MenuItem item) { |
| 92 | int itemId = item.getItemId(); |
| 93 | if (itemId == android.R.id.home) { |
| 94 | finish(); |
| 95 | return true; |
| 96 | } |
| 97 | return super.onOptionsItemSelected(item); |
| 98 | } |
| 99 | |
| 100 | private void load() { |
| 101 | Intent intent = getIntent(); |
| 102 | Uri uri = intent.getData(); |
| 103 | long id = intent.getLongExtra("id", -1L); |
| 104 | Log.i("DMARC uri=" + uri + " id=" + id); |
| 105 | |
| 106 | Bundle args = new Bundle(); |
| 107 | args.putParcelable("uri", uri); |
| 108 | args.putLong("id", id); |
| 109 | |
| 110 | new SimpleTask<Spanned>() { |
| 111 | @Override |
| 112 | protected void onPreExecute(Bundle args) { |
| 113 | pbWait.setVisibility(View.VISIBLE); |
| 114 | } |
| 115 |
nothing calls this directly
no outgoing calls
no test coverage detected