@Override public void onCreate(Bundle bundle) { super.onCreate(bundle); Thread.setDefaultUncaughtExceptionHandler( new org.geometerplus.zlibrary.ui.android.library.UncaughtExceptionHandler(this)); requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); requestWindowFeature(Window.FEATURE_NO_TITLE); setDefaultKeyMode(DEFAULT_KEYS_SEARCH_LOCAL); final SearchManager manager = (SearchManager) getSystemService(SEARCH_SERVICE); manager.setOnCancelListener(null); final TabHost host = getTabHost(); LayoutInflater.from(this).inflate(R.layout.bookmarks, host.getTabContentView(), true); myBook = SerializerUtil.deserializeBook(getIntent().getStringExtra(FBReader.BOOK_KEY)); }
@Override public void onCreate(Bundle bundle) { super.onCreate(bundle); Thread.setDefaultUncaughtExceptionHandler( new org.geometerplus.zlibrary.ui.android.library.UncaughtExceptionHandler(this)); // requestWindowFeature(Window.FEATURE_NO_TITLE); setDefaultKeyMode(DEFAULT_KEYS_SEARCH_LOCAL); final TabHost host = getTabHost(); LayoutInflater.from(this).inflate(R.layout.bookmarks, host.getTabContentView(), true); AllBooksBookmarks = Bookmark.bookmarks(); Collections.sort(AllBooksBookmarks, new Bookmark.ByTimeComparator()); final FBReader fbreader = (FBReader) FBReader.Instance(); if (fbreader.Model != null) { final long bookId = fbreader.Model.Book.getId(); for (Bookmark bookmark : AllBooksBookmarks) { if (bookmark.getBookId() == bookId) { myThisBookBookmarks.add(bookmark); } } myThisBookView = createTab("thisBook", R.id.this_book); new BookmarksAdapter(myThisBookView, myThisBookBookmarks, true); } else { findViewById(R.id.this_book).setVisibility(View.GONE); } myAllBooksView = createTab("allBooks", R.id.all_books); new BookmarksAdapter(myAllBooksView, AllBooksBookmarks, false); findViewById(R.id.search_results).setVisibility(View.GONE); }
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); TabHost tabHost = getTabHost(); tabHost.addTab( tabHost .newTabSpec("tab_test1") .setIndicator( getResources().getString(R.string.tab_playlist), getResources().getDrawable(R.drawable.ic_tab_playlist)) // .setContent(R.id.view1) .setContent(new Intent(this, PlaylistActivity.class))); tabHost.addTab( tabHost .newTabSpec("tab_test2") .setIndicator( getResources().getString(R.string.tab_favorites), getResources().getDrawable(R.drawable.ic_tab_sentencenote)) .setContent(new Intent(this, SentenceNoteActivity.class))); tabHost.addTab( tabHost .newTabSpec("tab_test3") .setIndicator( getResources().getString(R.string.tab_option), getResources().getDrawable(R.drawable.ic_tab_info)) .setContent(new Intent(this, OptionActivity.class))); mWaveLoopMain = (LinearLayout) findViewById(R.id.waveloop_main); mNowPlayingMain = (LinearLayout) findViewById(R.id.now_playing_main); mNowPlayingBtn = (ImageButton) findViewById(R.id.now_playing_btn); mNowPlayingArtist = (TextView) findViewById(R.id.now_playing_artist); mNowPlayingAlbum = (TextView) findViewById(R.id.now_playing_album); mNowPlayingTitle = (TextView) findViewById(R.id.now_playing_title); mNowPlayingPlayBtn = (ImageButton) findViewById(R.id.now_playing_playbtn); if (mService == null) { Intent i = new Intent(this, WaveLoopPlayerService.class); mService = startService(i); } }
private ListView createTab(String tag, int id) { final TabHost host = getTabHost(); final String label = myResource.getResource(tag).getValue(); host.addTab(host.newTabSpec(tag).setIndicator(label).setContent(id)); return (ListView) findViewById(id); }