Back to project page androidui.
The source code is released under:
MIT License
If you think the Android project androidui listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package course.examples.fragments.StaticLayout; //w w w. j av a 2 s . c om import android.app.Activity; import android.os.Bundle; import course.examples.fragments.StaticLayout.TitlesFragment.ListSelectionListener; public class QuoteViewerActivity extends Activity implements ListSelectionListener { static String[] sTitleArray; static String[] sQuoteArray; private QuotesFragment mDetailsFragment; @SuppressWarnings("unused") private static final String TAG = "QuoteViewerActivity"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Get the string arrays with the titles and quotes sTitleArray = getResources().getStringArray(R.array.Titles); sQuoteArray = getResources().getStringArray(R.array.Quotes); setContentView(R.layout.main); // Get a reference to the QuotesFragment mDetailsFragment = (QuotesFragment) getFragmentManager() .findFragmentById(R.id.details); } // Called when the user selects an item in the TitlesFragment @Override public void onListSelection(int index) { if (mDetailsFragment.getShownIndex() != index) { // Tell the QuoteFragment to show the quote string at position index mDetailsFragment.showQuoteAtIndex(index); } } }