List of usage examples for android.os Bundle getStringArrayList
@Override
@Nullable
public ArrayList<String> getStringArrayList(@Nullable String key)
From source file:net.wespot.pim.view.PimInquiriesFragment.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); INQ.init(this); INQ.accounts.syncMyAccountDetails(); ARL.eventBus.register(this); if (savedInstanceState != null) { }/* w w w. ja v a2 s. c o m*/ INQ.inquiry.syncInquiries(); setContentView(R.layout.fragment_inquiries); ListView inquiries = (ListView) findViewById(R.id.list_inquiries); LinearLayout linearLayout = (LinearLayout) findViewById(R.id.inquiries_new_inquiry); //////////////////////////////////// // When coming from notification bar //////////////////////////////////// Bundle extras = getIntent().getExtras(); if (extras != null) { ArrayList<String> list_id = extras.getStringArrayList(InqCommunicateFragment.INQUIRIES_ID); adapterInq = new InquiryLazyListAdapter(this, list_id); } else { adapterInq = new InquiryLazyListAdapter(this); } inquiries.setAdapter(adapterInq); adapterInq.setOnListItemClickCallback(this); // Instantiation of the buttonManager ButtonManager buttonManager = new ButtonManager(this); // Creation of layout params LinearLayout.LayoutParams secondLayoutParams = buttonManager.generateLayoutParams( R.dimen.mainscreen_margintop_zero, (int) getResources().getDimension(R.dimen.mainscreen_margintop_zero)); // New inquiry button buttonManager .generateButton(linearLayout, secondLayoutParams, Constants.ID_NEW_INQUIRY, Constants.INQUIRY_MAIN_LIST.get(Constants.ID_NEW_INQUIRY), Constants.INQUIRY_ICON_MAIN_LIST.get(Constants.ID_NEW_INQUIRY), "", true) .setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { INQ.inquiry.setCurrentInquiry(null); Intent intent; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { intent = new Intent(getApplicationContext(), InquiryActivity.class); } else { intent = new Intent(getApplicationContext(), InquiryActivityBack.class); } startActivity(intent); } }); setTitle(R.string.common_title); }
From source file:com.miz.service.IdentifyTvShowEpisodeService.java
@Override protected void onHandleIntent(Intent intent) { if (MizLib.isTvShowLibraryBeingUpdated(this)) { Handler mHandler = new Handler(Looper.getMainLooper()); mHandler.post(new Runnable() { @Override/*w w w. j a v a 2 s.c om*/ public void run() { Toast.makeText(IdentifyTvShowEpisodeService.this, R.string.cant_identify_while_updating, Toast.LENGTH_LONG).show(); } }); return; } log("clear()"); clear(); log("setup()"); setup(); log("Intent extras"); Bundle b = intent.getExtras(); mNewShowId = b.getString("newShowId"); mOldShowId = b.getString("oldShowId"); mLanguage = b.getString("language", "all"); mFilepaths = b.getStringArrayList("filepaths"); if (mFilepaths != null) { log("setupList()"); setupList(); log("removeOldDatabaseEntries()"); removeOldDatabaseEntries(); log("start()"); start(); } }
From source file:com.paranoid.gerrit.CardsFragment.java
@Override public Loader<Cursor> onCreateLoader(int id, Bundle args) { if (args != null) { String databaseQuery = args.getString("WHERE"); if (databaseQuery != null && !databaseQuery.isEmpty()) { if (args.getStringArrayList("BIND_ARGS") != null) { /* Create a copy as the findCommits function can modify the contents of bindArgs * and we want each receiver to use the bindArgs from the original broadcast */ ArrayList<String> bindArgs = new ArrayList<>(); bindArgs.addAll(args.getStringArrayList("BIND_ARGS")); return UserChanges.findCommits(mParent, getQuery(), databaseQuery, bindArgs); }//from www . j a v a 2s. c om } } return UserChanges.findCommits(mParent, getQuery(), null, null); }
From source file:com.skubit.android.example.MainActivity.java
public void fetchSkus(final ListView view) { Thread t = new Thread(new Runnable() { @Override/* ww w .ja va 2 s . com*/ public void run() { ArrayList<String> ids = new ArrayList<String>(); ///ids.add("445"); //ids.add("440"); ids.add("contribA"); final Bundle skusBundle = new Bundle(); skusBundle.putStringArrayList("ITEM_ID_LIST", ids); try { Bundle skuDetails = mService.getSkuDetails(1, getApplicationContext().getPackageName(), "donation", skusBundle); final ArrayList<String> details = skuDetails.getStringArrayList("DETAILS_LIST"); final SkusFragment skusFragment = (SkusFragment) mAdapter.getItem(0); runOnUiThread(new Runnable() { @Override public void run() { try { skusFragment.displaySkus(MainActivity.this, view, details); } catch (JSONException e) { e.printStackTrace(); } } }); } catch (Exception e) { e.printStackTrace(); } } }); t.start(); }
From source file:com.github.snowdream.android.apps.imageviewer.ImageViewerActivity.java
public void initData() { imageLoader = ImageLoader.getInstance(); imageUrls = new ArrayList<String>(); Intent intent = getIntent();//from w w w.j a v a 2s .c om if (intent != null) { Bundle bundle = intent.getExtras(); if (bundle != null) { imageUrls = bundle.getStringArrayList(Extra.IMAGES); imagePosition = bundle.getInt(Extra.IMAGE_POSITION, 0); imageMode = bundle.getInt(Extra.IMAGE_MODE, 0); Log.i("The snowdream bundle path of the image is: " + imageUri); } Uri uri = (Uri) intent.getData(); if (uri != null) { imageUri = uri.getPath(); fileName = uri.getLastPathSegment(); getSupportActionBar().setSubtitle(fileName); Log.i("The path of the image is: " + imageUri); File file = new File(imageUri); imageUri = "file://" + imageUri; File dir = file.getParentFile(); if (dir != null) { FileFilter fileFilter = new FileFilter() { @Override public boolean accept(File f) { if (f != null) { String extension = MimeTypeMap .getFileExtensionFromUrl(Uri.encode(f.getAbsolutePath())); if (!TextUtils.isEmpty(extension)) { String mimeType = MimeTypeMap.getSingleton() .getMimeTypeFromExtension(extension); if (!TextUtils.isEmpty(mimeType) && mimeType.contains("image")) { return true; } } } return false; } }; File[] files = dir.listFiles(fileFilter); if (files != null && files.length > 0) { int size = files.length; for (int i = 0; i < size; i++) { imageUrls.add("file://" + files[i].getAbsolutePath()); } imagePosition = imageUrls.indexOf(imageUri); imageMode = 1; Log.i("Image Position:" + imagePosition); } } else { imageUrls.add("file://" + imageUri); imagePosition = 0; imageMode = 0; } } } else { Log.w("The intent is null!"); } }
From source file:it.geosolutions.android.map.fragment.FeaturePolygonLayerListFragment.java
/** * Called once on creation//from w w w. ja v a2 s .c o m */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // view operations setRetainInstance(true); // get parameters to create the task query // TODO use arguments instead Bundle extras = getActivity().getIntent().getExtras(); FeaturePolygonQuery query = (FeaturePolygonQuery) extras.getParcelable("query"); ArrayList<String> layers = extras.getStringArrayList("layers"); // create a unique loader index // TODO use a better system to get the proper loader // TODO check if needed,maybe the activity has only one loader // create task query to execute on spatialite db queryQueue = FeatureInfoUtils.createTaskQueryQueue(layers, query, null, 1); // Initialize loader and callbacks for the parent activity // setup the listView adapter = new FeaturePolygonLayerLayerAdapter(getSherlockActivity(), R.layout.feature_info_layer_list_row); setListAdapter(adapter); //Crasha qui! }
From source file:csci310.parkhere.ui.fragments.PublicProfileFragment.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // if (getArguments() != null) { // mParam1 = getArguments().getString(ARG_PARAM1); // mParam2 = getArguments().getString(ARG_PARAM2); // mParam3 = getArguments().getString(ARG_PARAM3); // mParam4 = getArguments().getStringArray(ARG_PARAM4); // }/* ww w.j a v a 2 s . c o m*/ Bundle b = getArguments(); if (b != null) { fname = b.getString("FIRSTNAME"); email = b.getString("EMAIL"); phone_num = b.getString("PHONE_NUM"); reviews = b.getStringArrayList("REVIEWS"); Log.d("Public Profile ", "fname = " + fname); Log.d("Public Profile ", "email = " + email); Log.d("Public Profile ", "phone_num = " + phone_num); Log.d("Public Profile ", "reviews.size() = " + reviews.size()); } setHasOptionsMenu(true); }
From source file:it.geosolutions.android.map.fragment.FeatureInfoLayerListFragment.java
/** * Called once on creation/*from www. j av a2 s .c o m*/ */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // view operations setRetainInstance(true); // get parameters to create the task query // TODO use arguments instead Bundle extras = getActivity().getIntent().getExtras(); FeatureInfoQuery query = (FeatureInfoQuery) extras.getParcelable("query"); ArrayList<String> layers = extras.getStringArrayList("layers"); // create a unique loader index // TODO use a better system to get the proper loader // TODO check if needed,maybe the activity has only one loader // create task query //queryQueue = createTaskQueryQueue(layers, query); queryQueue = FeatureInfoUtils.createTaskQueryQueue(layers, query, null, 1); // Initialize loader and callbacks for the parent activity // setup the listView adapter = new FeatureInfoLayerLayerdapter(getSherlockActivity(), R.layout.feature_info_layer_list_row); setListAdapter(adapter); }
From source file:it.geosolutions.android.map.fragment.FeatureCircleLayerListFragment.java
/** * Called once on creation/*from w w w .ja va2s . c o m*/ */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // view operations setRetainInstance(true); // get parameters to create the task query // TODO use arguments instead Bundle extras = getActivity().getIntent().getExtras(); FeatureCircleQuery query = (FeatureCircleQuery) extras.getParcelable("query"); ArrayList<String> layers = extras.getStringArrayList("layers"); // create a unique loader index // TODO use a better system to get the proper loader // TODO check if needed,maybe the activity has only one loader // create task query to execute on spatialite db queryQueue = FeatureInfoUtils.createTaskQueryQueue(layers, query, null, 1); // Initialize loader and callbacks for the parent activity // setup the listView adapter = new FeatureCircleLayerLayerAdapter(getSherlockActivity(), R.layout.feature_info_layer_list_row); setListAdapter(adapter); }
From source file:com.giangnvt.fragment.FlashcardPagerFragment.java
@Override public void readFragmentBundle() { super.readFragmentBundle(); Bundle bundle = getArguments(); if (bundle != null) { flashcardPrefKey = bundle.getString(BUNDLE_FLASHCARD_PREF_KEY); if (bundle.containsKey(BUNDLE_ENTRY_ID_LIST)) { entryIdList = bundle.getStringArrayList(BUNDLE_ENTRY_ID_LIST); } else if (bundle.containsKey(BUNDLE_DATA_FILENAME)) { dataFilename = bundle.getString(BUNDLE_DATA_FILENAME); entryIdList = new ArrayList<>(); List<Integer> tmpList = FileUtil.readBinaryFileToIntegerList(getContext(), dataFilename); // Exclude the index value at list top for (int i = Constant.NUMBER_OF_SCROLL_INDEX; i < tmpList.size(); i++) { entryIdList.add(String.valueOf(tmpList.get(i))); }//from w w w . j av a 2 s . co m } else { throw new RuntimeException(); } tableName = bundle.getString(BUNDLE_TABLE_NAME); } }