List of usage examples for android.os Bundle getLong
public long getLong(String key)
From source file:com.app_software.chromisstock.StockChangeDialog.java
@Override public void setArguments(Bundle args) { if (args.containsKey(ARG_PRODUCTID)) { m_ProductID = args.getLong(ARG_PRODUCTID); }//from ww w. j a v a 2 s. c om if (args.containsKey(ARG_FIELD)) { m_Field = args.getString(ARG_FIELD); m_bAllowAdjust = (m_Field.compareTo(StockProduct.QTY_INSTOCK) == 0); m_bIsNumber = m_bAllowAdjust || (m_Field.compareTo(StockProduct.PRICEBUY) == 0) || (m_Field.compareTo(StockProduct.PRICESELL) == 0) || (m_Field.compareTo(StockProduct.QTY_MAX) == 0) || (m_Field.compareTo(StockProduct.QTY_MIN) == 0); } if (args.containsKey(ARG_FIELD_LABEL)) { m_FieldLabel = args.getString(ARG_FIELD_LABEL); } if (args.containsKey(ARG_CHANGETYPE)) { m_ChangeType = args.getInt(ARG_CHANGETYPE); } if (args.containsKey(ARG_VALUE)) { m_Value = args.getString(ARG_VALUE); } }
From source file:com.enadein.carlogbook.core.SaveUpdateBaseActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Bundle params = getIntent().getExtras(); if (params != null) { mode = params.getInt(BaseActivity.MODE_KEY); id = params.getLong(BaseActivity.ENTITY_ID); populateExtraParams(params);/* w w w.j a v a2s.c o m*/ } ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setHomeButtonEnabled(true); } postCreate(); populateEntity(); postPopulate(); }
From source file:cl.ipp.katbag.fragment.PlayerBook.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { v = (LinearLayout) inflater.inflate(R.layout.fragment_player_book, container, false); mainActivity = (MainActivity) super.getActivity(); // rescues parameters Bundle bundle = getArguments(); if (bundle != null) { id_app = bundle.getLong("id_app"); name_app_text = bundle.getString("name_app"); }//from w w w . j ava2 s . co m numPages = mainActivity.katbagHandler.countPagesForIdApp(id_app); // Instantiate a ViewPager and a PagerAdapter. mPager = (ViewPager) v.findViewById(R.id.pager); // mPager.setPageTransformer(true, new DepthPageTransformer()); mPagerAdapter = new ScreenSlidePagerAdapter(getFragmentManager()); mPager.setAdapter(mPagerAdapter); mIndicator = (UnderlinePageIndicator) v.findViewById(R.id.indicator); mIndicator.setViewPager(mPager); mIndicator.setFades(false); setPageSound(0); mIndicator.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() { @Override public void onPageSelected(int position) { setPageSound(position); } }); return v; }
From source file:com.launcher.silverfish.launcher.appdrawer.AppDrawerTabFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // get the sql database helper and the view of this tab sqlHelper = new LauncherSQLiteHelper((App) getActivity().getApplication()); settings = new Settings(getContext()); rootView = inflater.inflate(R.layout.activity_app_drawer_tab, container, false); emptyCategoryTextView = (TextView) rootView.findViewById(R.id.textView_empty_category_notice); // Get this tab's ID. Bundle args = getArguments(); tabId = args.getLong(Constants.TAB_ID); appsView = (GridView) rootView.findViewById(R.id.apps_grid); mPacMan = getActivity().getPackageManager(); appsList = new ArrayList<>(); setColors(settings.getDrawerBgColor(), settings.getFontFgColor()); // Load the apps and update the view loadApps();/*from w w w .java 2 s . com*/ loadGridView(); return rootView; }
From source file:com.rks.musicx.ui.fragments.AlbumFragment.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Bundle args = getArguments(); if (args != null) { long id = args.getLong(ALBUM_ID); String title = args.getString(ALBUM_NAME); String artist = args.getString(ALBUM_ARTIST); int year = args.getInt(ALBUM_YEAR); int trackCount = args.getInt(ALBUM_TRACK_COUNT); mAlbum = new Album(); mAlbum.setAlbumName(title);// w w w . j a va2 s. co m mAlbum.setId(id); mAlbum.setArtistName(artist); mAlbum.setYear(year); mAlbum.setTrackCount(trackCount); } }
From source file:com.lkunic.libs.apptoolbox.twopane.fragments.ItemDetailFragment.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (savedInstanceState != null && savedInstanceState.containsKey(ARG_ITEM_ID)) { // Load the item id from the saved instance mItemId = savedInstanceState.getLong(ARG_ITEM_ID); }/*from ww w. ja v a 2 s .c om*/ }
From source file:com.rks.musicx.ui.fragments.PlaylistFragment.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Bundle args = getArguments(); setHasOptionsMenu(true);/* w ww. j a v a 2 s. c o m*/ if (args != null) { long id = args.getLong(PARAM_PLAYLIST_ID); String name = args.getString(PARAM_PLAYLIST_NAME); mPlaylist = new Playlist(); mPlaylist.setId(id); mPlaylist.setName(name); } }
From source file:cl.ipp.katbag.fragment.Pages.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { mainActivity = (MainActivity) super.getActivity(); v = inflater.inflate(R.layout.fragment_pages, container, false); mainActivity.supportInvalidateOptionsMenu(); // rescues parameters Bundle bundle = getArguments(); if (bundle != null) { id_app = bundle.getLong("id_app"); }/*from w ww. j av a 2 s . co m*/ notRegister = (TextView) v.findViewById(R.id.page_not_register); editMode = false; loadListView(); pagesListView.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { if (!editMode) { TextView pageld = (TextView) view.findViewById(R.id.page_row_id); Bundle bundle = new Bundle(); bundle.putLong("id_app", id_app); bundle.putLong("id_page", Long.valueOf(pageld.getText().toString())); bundle.putString("name_page", String.valueOf(position)); mFragment = new OnePage(); mFragment.setArguments(bundle); FragmentTransaction t = getActivity().getSupportFragmentManager().beginTransaction(); t.replace(R.id.fragment_main_container, mFragment); t.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE); t.addToBackStack(mFragment.getClass().getSimpleName()); t.commit(); } } }); return v; }
From source file:de.arcus.playmusicexporter2.services.ExportService.java
/** * New service request//ww w.j av a2 s . com * @param intent Data for the exporter */ @Override protected void onHandleIntent(Intent intent) { // Get the parameter Bundle bundle = intent.getExtras(); // Gets the track information long trackID = bundle.getLong(ARG_EXPORT_TRACK_ID); Uri uri = Uri.parse(bundle.getString(ARG_EXPORT_URI)); String path = bundle.getString(ARG_EXPORT_PATH); PlayMusicManager playMusicManager = PlayMusicManager.getInstance(); if (playMusicManager != null) { // Creates a new data source to get the selected track MusicTrackDataSource musicTrackDataSource = new MusicTrackDataSource(playMusicManager); // Gets the track mTrackCurrent = musicTrackDataSource.getById(trackID); if (mTrackCurrent != null) { // Updates the notification updateNotification(); // Exports the song if (!playMusicManager.exportMusicTrack(mTrackCurrent, uri, path)) { // Export failed mTracksFailed++; } } else { // Export failed mTracksFailed++; } } else { // Export failed mTracksFailed++; } mTracksDone++; // Updates the notification updateNotification(); }
From source file:com.fenyx4.arkham.GUI.LocationDeckActivity.java
/** Called when the activity is first created. */ @Override/* www.jav a 2 s. c om*/ public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.locationdeck); AHFlyweightFactory.INSTANCE.Init(this.getApplicationContext()); Bundle extras = getIntent().getExtras(); neiID = extras.getLong("neighborhood"); ViewPager viewpager = (ViewPager) findViewById(R.id.viewpager); viewpager.setAdapter(new CardAdapter(this, GameState.getInstance().getDeckByNeighborhood(neiID))); //viewpager.setBackgroundColor(Color.CYAN); }