Android Open Source - disconnected-content-explorer-android Report Detail Activity






From Project

Back to project page disconnected-content-explorer-android.

License

The source code is released under:

MIT License

If you think the Android project disconnected-content-explorer-android 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 mil.nga.dice.report;
// w ww  .  j  a  v a 2  s  .  c  o m
import mil.nga.dice.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;

/**
 * This activity is mostly just a 'shell' activity containing nothing more than
 * a {@link ReportDetailFragment}.
 */
public class ReportDetailActivity extends Activity {
  
  Report mReport;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_report_detail);

    Bundle bundle = getIntent().getExtras();
    mReport = bundle.getParcelable("report");
    setTitle(mReport.getTitle());
    
    // Show the Up button in the action bar.
    getActionBar().setDisplayHomeAsUpEnabled(true);
    
    if (savedInstanceState == null) {
      // Create the detail fragment and add it to the activity
      // using a fragment transaction.
      Bundle arguments = new Bundle();
      arguments.putString(ReportDetailFragment.ARG_ITEM_ID, getIntent().getStringExtra(ReportDetailFragment.ARG_ITEM_ID));
      arguments.putParcelable(ReportDetailFragment.ARG_REPORT, mReport);
      ReportDetailFragment fragment = new ReportDetailFragment();
      fragment.setArguments(arguments);
      getFragmentManager().beginTransaction()
          .add(R.id.report_detail_container, fragment).commit();
    }
  }
  
  
  private void openNote() {
    Intent noteIntent = new Intent(this, NoteActivity.class);
    noteIntent.putExtra("report", mReport);
    startActivity(noteIntent);
  }

  
  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
      case android.R.id.home: 
        finish();
        return true;
      case R.id.open_note:
        openNote();
        return true;
    }
    
    return super.onOptionsItemSelected(item);
  }
  
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
      MenuInflater inflater = getMenuInflater();
      inflater.inflate(R.menu.report_menu, menu);
      return true;
  }
}




Java Source Code List

mil.nga.dice.DICE.java
mil.nga.dice.gridview.CustomGrid.java
mil.nga.dice.gridview.ReportGridActivity.java
mil.nga.dice.gridview.ReportGridFragment.java
mil.nga.dice.jackson.deserializer.Deserializer.java
mil.nga.dice.jackson.deserializer.FeatureDeserializer.java
mil.nga.dice.jackson.deserializer.GeometryDeserializer.java
mil.nga.dice.listview.CustomList.java
mil.nga.dice.listview.ReportListActivity.java
mil.nga.dice.listview.ReportListFragment.java
mil.nga.dice.listview.ReportListItem.java
mil.nga.dice.map.BackgroundTileProvider.java
mil.nga.dice.map.OfflineMapLoader.java
mil.nga.dice.map.OfflineMap.java
mil.nga.dice.map.ReportMapActivity.java
mil.nga.dice.map.ReportMapFragment.java
mil.nga.dice.report.NoteActivity.java
mil.nga.dice.report.NoteFragment.java
mil.nga.dice.report.ReportDetailActivity.java
mil.nga.dice.report.ReportDetailFragment.java
mil.nga.dice.report.ReportDropbox.java
mil.nga.dice.report.ReportManager.java
mil.nga.dice.report.ReportUnzipRunnable.java
mil.nga.dice.report.Report.java