src/com/glacialsoftware/pcapreader/PcapDisplayActivity.java
@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		//created=true;
		
		if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean("tilt_lock", false)){
			setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
		} else {
			setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
		}
		
		setContentView(R.layout.activity_pcap_display);
		
		if (PcapFileLoader.filename==null){
			Log.d("PcapDisplayActivity","Null filename - finishing");
			finish();
		}
		
		File file = new File(PcapFileLoader.filename);
		setTitle(file.getName());
		
		detailsShowing=false;
		firstVisiblePosition=0;
		preferencesShowing=false;
		licensesShowing=false;
		if (savedInstanceState!=null){
			detailsShowing=savedInstanceState.getBoolean("detailsShowing");
			firstVisiblePosition=savedInstanceState.getInt("firstVisiblePosition");
			preferencesShowing=savedInstanceState.getBoolean("preferencesShowing");
			licensesShowing=savedInstanceState.getBoolean("licensesShowing");
		}
		
		if (findViewById(R.id.pcap_display_frame) !=null){
			pcapReaderPreferenceFragment=new PcapReaderPreferenceFragment();
			packetListFragment = new PacketListFragment();
			packetDetailsFragment = new PacketDetailsFragment();
			licenseFragment = new LicenseFragment();
			FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction();
			fragmentTransaction.add(R.id.pcap_display_frame, packetListFragment);
			fragmentTransaction.add(R.id.pcap_display_frame, packetDetailsFragment);
			fragmentTransaction.add(R.id.pcap_display_frame, pcapReaderPreferenceFragment);
			fragmentTransaction.add(R.id.pcap_display_frame, licenseFragment);
			fragmentTransaction.hide(packetDetailsFragment);
			fragmentTransaction.hide(pcapReaderPreferenceFragment);
			fragmentTransaction.hide(licenseFragment);
			fragmentTransaction.commit();
		}
	}
//private boolean created=false;
private boolean created=false.
private boolean created = false .
@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean("tilt_lock", false)){
			setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
		} else {
			setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
		}
		setContentView(R.layout.activity_pcap_display);
		if (PcapFileLoader.filename==null){
			Log.d("PcapDisplayActivity","Null filename - finishing");
			finish();
		}
		File file = new File(PcapFileLoader.filename);
		setTitle(file.getName());
		detailsShowing=false;
		firstVisiblePosition=0;
		preferencesShowing=false;
		licensesShowing=false;
		if (savedInstanceState!=null){
			detailsShowing=savedInstanceState.getBoolean("detailsShowing");
			firstVisiblePosition=savedInstanceState.getInt("firstVisiblePosition");
			preferencesShowing=savedInstanceState.getBoolean("preferencesShowing");
			licensesShowing=savedInstanceState.getBoolean("licensesShowing");
		}
		if (findViewById(R.id.pcap_display_frame) !=null){
			pcapReaderPreferenceFragment=new PcapReaderPreferenceFragment();
			packetListFragment = new PacketListFragment();
			packetDetailsFragment = new PacketDetailsFragment();
			licenseFragment = new LicenseFragment();
			FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction();
			fragmentTransaction.add(R.id.pcap_display_frame, packetListFragment);
			fragmentTransaction.add(R.id.pcap_display_frame, packetDetailsFragment);
			fragmentTransaction.add(R.id.pcap_display_frame, pcapReaderPreferenceFragment);
			fragmentTransaction.add(R.id.pcap_display_frame, licenseFragment);
			fragmentTransaction.hide(packetDetailsFragment);
			fragmentTransaction.hide(pcapReaderPreferenceFragment);
			fragmentTransaction.hide(licenseFragment);
			fragmentTransaction.commit();
		}
	}
@ Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; if ( PreferenceManager . getDefaultSharedPreferences ( this ) . getBoolean ( "tilt_lock" , false ) ) { setRequestedOrientation ( ActivityInfo . SCREEN_ORIENTATION_PORTRAIT ) ; } else { setRequestedOrientation ( ActivityInfo . SCREEN_ORIENTATION_UNSPECIFIED ) ; } setContentView ( R . layout . activity_pcap_display ) ; if ( PcapFileLoader . filename == null ) { Log . d ( "PcapDisplayActivity" , "Null filename - finishing" ) ; finish ( ) ; } File file = new File ( PcapFileLoader . filename ) ; setTitle ( file . getName ( ) ) ; detailsShowing = false ; firstVisiblePosition = 0 ; preferencesShowing = false ; licensesShowing = false ; if ( savedInstanceState != null ) { detailsShowing = savedInstanceState . getBoolean ( "detailsShowing" ) ; firstVisiblePosition = savedInstanceState . getInt ( "firstVisiblePosition" ) ; preferencesShowing = savedInstanceState . getBoolean ( "preferencesShowing" ) ; licensesShowing = savedInstanceState . getBoolean ( "licensesShowing" ) ; } if ( findViewById ( R . id . pcap_display_frame ) != null ) { pcapReaderPreferenceFragment = new PcapReaderPreferenceFragment ( ) ; packetListFragment = new PacketListFragment ( ) ; packetDetailsFragment = new PacketDetailsFragment ( ) ; licenseFragment = new LicenseFragment ( ) ; FragmentTransaction fragmentTransaction = getFragmentManager ( ) . beginTransaction ( ) ; fragmentTransaction . add ( R . id . pcap_display_frame , packetListFragment ) ; fragmentTransaction . add ( R . id . pcap_display_frame , packetDetailsFragment ) ; fragmentTransaction . add ( R . id . pcap_display_frame , pcapReaderPreferenceFragment ) ; fragmentTransaction . add ( R . id . pcap_display_frame , licenseFragment ) ; fragmentTransaction . hide ( packetDetailsFragment ) ; fragmentTransaction . hide ( pcapReaderPreferenceFragment ) ; fragmentTransaction . hide ( licenseFragment ) ; fragmentTransaction . commit ( ) ; } }
private boolean created=false;
private boolean created = false ;
//created=true;