List of usage examples for android.content Intent CATEGORY_BROWSABLE
String CATEGORY_BROWSABLE
To view the source code for android.content Intent CATEGORY_BROWSABLE.
Click Source Link
From source file:com.nbplus.hybrid.BasicWebViewClient.java
@JavascriptInterface public void postUrl(String url, String data) { Intent intent = new Intent(Intent.ACTION_VIEW).addCategory(Intent.CATEGORY_BROWSABLE) .setPackage("com.android.chrome") // open only chrome .setData(Uri.parse(url));/* w w w . j a va2 s . com*/ mContext.startActivity(intent); }
From source file:org.liberty.android.fantastischmemo.ui.MiscTabFragment.java
@Override public void onClick(View v) { if (v == optionButton) { startActivity(new Intent(mActivity, OptionScreen.class)); }/*from www . jav a 2 s.c om*/ /* Toggle visibility for import and export buttons */ if (v == importButton) { if (importItems.getVisibility() == View.GONE) { importItems.setVisibility(View.VISIBLE); } else { importItems.setVisibility(View.GONE); } } if (v == exportButton) { if (exportItems.getVisibility() == View.GONE) { exportItems.setVisibility(View.VISIBLE); } else { exportItems.setVisibility(View.GONE); } } if (v == importMnemosyneButton) { DialogFragment df = new ConverterFragment(); Bundle b = new Bundle(); b.putSerializable(ConverterFragment.EXTRA_CONVERTER_CLASS, MnemosyneXMLImporter.class); b.putString(FileBrowserFragment.EXTRA_FILE_EXTENSIONS, ".xml"); df.setArguments(b); df.show(((FragmentActivity) mActivity).getSupportFragmentManager(), "ImportMnemosyne"); } if (v == importSupermemoButton) { DialogFragment df = new ConverterFragment(); Bundle b = new Bundle(); b.putSerializable(ConverterFragment.EXTRA_CONVERTER_CLASS, SupermemoXMLImporter.class); b.putString(FileBrowserFragment.EXTRA_FILE_EXTENSIONS, ".xml"); df.setArguments(b); df.show(((FragmentActivity) mActivity).getSupportFragmentManager(), "ImportSuperMemo2008"); } if (v == importCSVButton) { DialogFragment df = new ConverterFragment(); Bundle b = new Bundle(); b.putSerializable(ConverterFragment.EXTRA_CONVERTER_CLASS, CSVImporter.class); b.putString(FileBrowserFragment.EXTRA_FILE_EXTENSIONS, ".csv"); df.setArguments(b); df.show(((FragmentActivity) mActivity).getSupportFragmentManager(), "ImportCSV"); } if (v == importZipButton) { DialogFragment df = new ConverterFragment(); Bundle b = new Bundle(); b.putSerializable(ConverterFragment.EXTRA_CONVERTER_CLASS, ZipImporter.class); b.putString(FileBrowserFragment.EXTRA_FILE_EXTENSIONS, ".zip"); df.setArguments(b); df.show(((FragmentActivity) mActivity).getSupportFragmentManager(), "ImportZip"); } if (v == importTabButton) { DialogFragment df = new ConverterFragment(); Bundle b = new Bundle(); b.putSerializable(ConverterFragment.EXTRA_CONVERTER_CLASS, TabTxtImporter.class); b.putString(FileBrowserFragment.EXTRA_FILE_EXTENSIONS, ".txt"); df.setArguments(b); df.show(((FragmentActivity) mActivity).getSupportFragmentManager(), "ImportTabTxt"); } if (v == importQAButton) { DialogFragment df = new ConverterFragment(); Bundle b = new Bundle(); b.putSerializable(ConverterFragment.EXTRA_CONVERTER_CLASS, QATxtImporter.class); b.putString(FileBrowserFragment.EXTRA_FILE_EXTENSIONS, ".txt"); df.setArguments(b); df.show(((FragmentActivity) mActivity).getSupportFragmentManager(), "ImportCSV"); } if (v == importSupermemo2008Button) { DialogFragment df = new ConverterFragment(); Bundle b = new Bundle(); b.putSerializable(ConverterFragment.EXTRA_CONVERTER_CLASS, Supermemo2008XMLImporter.class); b.putString(FileBrowserFragment.EXTRA_FILE_EXTENSIONS, ".xml"); df.setArguments(b); df.show(((FragmentActivity) mActivity).getSupportFragmentManager(), "ImportSuperMemo2008"); } if (v == importMnemosyne2CardsButton) { DialogFragment df = new ConverterFragment(); Bundle b = new Bundle(); b.putSerializable(ConverterFragment.EXTRA_CONVERTER_CLASS, Mnemosyne2CardsImporter.class); b.putString(FileBrowserFragment.EXTRA_FILE_EXTENSIONS, ".cards"); df.setArguments(b); df.show(((FragmentActivity) mActivity).getSupportFragmentManager(), "ImportMnemosyne2Cards"); } if (v == exportMnemosyneButton) { DialogFragment df = new ConverterFragment(); Bundle b = new Bundle(); b.putSerializable(ConverterFragment.EXTRA_CONVERTER_CLASS, MnemosyneXMLExporter.class); b.putString(FileBrowserFragment.EXTRA_FILE_EXTENSIONS, ".db"); df.setArguments(b); df.show(((FragmentActivity) mActivity).getSupportFragmentManager(), "ExportMnemosyne"); } if (v == exportCSVButton) { DialogFragment df = new ConverterFragment(); Bundle b = new Bundle(); b.putSerializable(ConverterFragment.EXTRA_CONVERTER_CLASS, CSVExporter.class); b.putString(FileBrowserFragment.EXTRA_FILE_EXTENSIONS, ".db"); df.setArguments(b); df.show(((FragmentActivity) mActivity).getSupportFragmentManager(), "ExportCSV"); } if (v == exportTabButton) { DialogFragment df = new ConverterFragment(); Bundle b = new Bundle(); b.putSerializable(ConverterFragment.EXTRA_CONVERTER_CLASS, TabTxtExporter.class); b.putString(FileBrowserFragment.EXTRA_FILE_EXTENSIONS, ".db"); df.setArguments(b); df.show(((FragmentActivity) mActivity).getSupportFragmentManager(), "ExportTabTxt"); } if (v == exportQAButton) { DialogFragment df = new ConverterFragment(); Bundle b = new Bundle(); b.putSerializable(ConverterFragment.EXTRA_CONVERTER_CLASS, QATxtExporter.class); b.putString(FileBrowserFragment.EXTRA_FILE_EXTENSIONS, ".db"); df.setArguments(b); df.show(((FragmentActivity) mActivity).getSupportFragmentManager(), "ExportQA"); } if (v == exportZipButton) { DialogFragment df = new ConverterFragment(); Bundle b = new Bundle(); b.putSerializable(ConverterFragment.EXTRA_CONVERTER_CLASS, ZipExporter.class); b.putString(FileBrowserFragment.EXTRA_FILE_EXTENSIONS, ".db"); df.setArguments(b); df.show(((FragmentActivity) mActivity).getSupportFragmentManager(), "ExportZip"); } if (v == exportMnemosyne2CardsButton) { DialogFragment df = new ConverterFragment(); Bundle b = new Bundle(); b.putSerializable(ConverterFragment.EXTRA_CONVERTER_CLASS, Mnemosyne2CardsExporter.class); b.putString(FileBrowserFragment.EXTRA_FILE_EXTENSIONS, ".db"); df.setArguments(b); df.show(((FragmentActivity) mActivity).getSupportFragmentManager(), "ExportMnemosyne2Cards"); } if (v == defaultSettingsButton) { Intent intent = new Intent(mActivity, SettingsScreen.class); String emptyDbPath = mActivity.getApplicationContext().getFilesDir().getAbsolutePath() + "/" + AMEnv.EMPTY_DB_NAME; intent.putExtra(SettingsScreen.EXTRA_DBPATH, emptyDbPath); startActivity(intent); } if (v == mergeButton) { Intent myIntent = new Intent(mActivity, DatabaseMerger.class); startActivity(myIntent); } if (v == resetButton) { new AlertDialog.Builder(mActivity).setTitle(R.string.clear_all_pref) .setMessage(R.string.reset_all_pref_warning) .setPositiveButton(R.string.ok_text, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface arg0, int arg1) { SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(mActivity); SharedPreferences.Editor editor = settings.edit(); editor.clear(); editor.commit(); mActivity.finish(); } }).setNegativeButton(R.string.cancel_text, null).show(); } if (v == donateButton) { View alertView = View.inflate(mActivity, R.layout.link_alert, null); TextView textView = (TextView) alertView.findViewById(R.id.link_alert_message); textView.setText(Html.fromHtml(getString(R.string.donate_summary))); textView.setMovementMethod(LinkMovementMethod.getInstance()); new AlertDialog.Builder(mActivity).setView(alertView).setTitle(R.string.donate_text) .setPositiveButton(getString(R.string.buy_pro_text), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface arg0, int arg1) { Intent myIntent = new Intent(); myIntent.setAction(Intent.ACTION_VIEW); myIntent.addCategory(Intent.CATEGORY_BROWSABLE); myIntent.setData(Uri.parse(getString(R.string.anymemo_pro_link))); startActivity(myIntent); } }).setNegativeButton(getString(R.string.cancel_text), null).show(); } if (v == helpButton) { Intent myIntent = new Intent(); myIntent.setAction(Intent.ACTION_VIEW); myIntent.addCategory(Intent.CATEGORY_BROWSABLE); myIntent.setData(Uri.parse(WEBSITE_VERSION)); startActivity(myIntent); } if (v == aboutButton) { // Get the version defined in the AndroidManifest. String versionName = ""; try { versionName = getActivity().getPackageManager().getPackageInfo(getActivity().getPackageName(), 0).versionName; } catch (PackageManager.NameNotFoundException e) { versionName = "1.0"; } View alertView = View.inflate(mActivity, R.layout.link_alert, null); TextView textView = (TextView) alertView.findViewById(R.id.link_alert_message); textView.setText(Html.fromHtml(getString(R.string.about_text))); textView.setMovementMethod(LinkMovementMethod.getInstance()); new AlertDialog.Builder(mActivity).setView(alertView) .setTitle(getString(R.string.app_full_name) + " " + versionName) .setPositiveButton(getString(R.string.ok_text), null) .setNegativeButton(getString(R.string.about_version), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface arg0, int arg1) { Intent myIntent = new Intent(); myIntent.setAction(Intent.ACTION_VIEW); myIntent.addCategory(Intent.CATEGORY_BROWSABLE); myIntent.setData(Uri.parse(WEBSITE_VERSION)); startActivity(myIntent); } }).show(); } }
From source file:og.android.tether.MainActivity.java
private void openAdBar() { LayoutInflater li = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE); final View ad_view = li.inflate(R.layout.ad_view, null); ad_view.setBackgroundColor(Color.TRANSPARENT); final WindowManager wm = getWindowManager(); WindowManager.LayoutParams wmParams = new WindowManager.LayoutParams(); wmParams.height = WindowManager.LayoutParams.WRAP_CONTENT; wmParams.width = WindowManager.LayoutParams.WRAP_CONTENT; wmParams.gravity = Gravity.BOTTOM;//from www . ja va 2s . c om wmParams.y = 100; wmParams.flags = WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL; wmParams.format = PixelFormat.TRANSLUCENT; wm.addView(ad_view, wmParams); View ad_open = ad_view.findViewById(R.id.ad_open); View ad_close = ad_view.findViewById(R.id.ad_close); OnClickListener adListener = new OnClickListener() { @Override public void onClick(View v) { switch (v.getId()) { case R.id.ad_open: Log.i(MSG_TAG, "ad_open"); Intent i = new Intent(); i.setAction(Intent.ACTION_VIEW); i.addCategory(Intent.CATEGORY_BROWSABLE); i.setData(Uri.parse( "market://details?id=com.opengarden.radiofreenet&referrer=utm_source%3Dog.android.tether%26utm_medium%3Dandroid%26utm_campaign%3Dbanner%26utm_content%3Dinstall")); try { startActivity(i); } catch (android.content.ActivityNotFoundException e) { Log.e(MSG_TAG, "", e); MainActivity.this.application.displayToastMessage(e.toString()); } break; case R.id.ad_close: Log.i(MSG_TAG, "ad_close"); wm.removeView(ad_view); break; default: Log.i(MSG_TAG, "default"); break; } } }; ad_open.setOnClickListener(adListener); ad_close.setOnClickListener(adListener); }
From source file:net.bytten.comicviewer.ComicViewerActivity.java
public void donate() { Intent browser = new Intent(); browser.setAction(Intent.ACTION_VIEW); browser.addCategory(Intent.CATEGORY_BROWSABLE); browser.setData(comicDef.getDonateUrl()); startActivity(browser);/*from w w w . j a va 2 s . c om*/ }
From source file:net.bytten.comicviewer.ComicViewerActivity.java
public void developerWebsite() { Intent browser = new Intent(); browser.setAction(Intent.ACTION_VIEW); browser.addCategory(Intent.CATEGORY_BROWSABLE); browser.setData(comicDef.getDeveloperUrl()); startActivity(browser);//from ww w.ja v a 2s . c o m }
From source file:net.bytten.comicviewer.ComicViewerActivity.java
public void launchWebsite() { Intent browser = new Intent(); browser.setAction(Intent.ACTION_VIEW); browser.addCategory(Intent.CATEGORY_BROWSABLE); browser.setData(Uri.parse(comicInfo.getUrl())); startActivity(browser);/*from w ww . ja va 2 s .c o m*/ }
From source file:net.bytten.comicviewer.ComicViewerActivity.java
public void openComicLink() { Intent browser = new Intent(); browser.setAction(Intent.ACTION_VIEW); browser.addCategory(Intent.CATEGORY_BROWSABLE); browser.setData(comicInfo.getLink()); startActivity(browser);//from w ww. j a v a 2 s. c o m }
From source file:com.linkbubble.Settings.java
public void updateBrowsers() { if (mBrowsers == null) { mBrowsers = new Vector<Intent>(); mBrowserPackageNames = new ArrayList<String>(); } else {/*from w ww . j a v a 2 s. co m*/ mBrowsers.clear(); mBrowserPackageNames.clear(); } PackageManager packageManager = mContext.getPackageManager(); Intent queryIntent = new Intent(); queryIntent.setAction(Intent.ACTION_VIEW); queryIntent.setData(Uri.parse("http://www.fdasfjsadfdsfas.com")); // Something stupid that no non-browser app will handle List<ResolveInfo> resolveInfos = packageManager.queryIntentActivities(queryIntent, PackageManager.GET_RESOLVED_FILTER); String fallbackDefaultBrowserPackageName = null; String fallbackDefaultBrowserActivityClassName = null; for (ResolveInfo resolveInfo : resolveInfos) { IntentFilter filter = resolveInfo.filter; if (filter != null && filter.hasAction(Intent.ACTION_VIEW) && filter.hasCategory(Intent.CATEGORY_BROWSABLE)) { // Ignore LinkBubble from this list if (resolveInfo.activityInfo.packageName.equals(BuildConfig.APPLICATION_ID)) { mLinkBubbleEntryActivityResolveInfo = resolveInfo; } else if (Util.isValidBrowserPackageName(resolveInfo.activityInfo.packageName)) { Intent intent = new Intent(Intent.ACTION_VIEW); intent.setClassName(resolveInfo.activityInfo.packageName, resolveInfo.activityInfo.name); mBrowsers.add(intent); mBrowserPackageNames.add(resolveInfo.activityInfo.packageName); if (resolveInfo.activityInfo.packageName .equals(mContext.getResources().getString(R.string.tab_based_browser_id_name))) { fallbackDefaultBrowserPackageName = resolveInfo.activityInfo.packageName; fallbackDefaultBrowserActivityClassName = resolveInfo.activityInfo.name; } } } } String defaultBrowserPackage = mSharedPreferences.getString(PREFERENCE_DEFAULT_BROWSER_PACKAGE_NAME, null); //String rightConsumeBubblePackageName = mSharedPreferences.getString(PREFERENCE_RIGHT_CONSUME_BUBBLE_PACKAGE_NAME, null); String leftConsumeBubblePackageName = mSharedPreferences .getString(PREFERENCE_LEFT_CONSUME_BUBBLE_PACKAGE_NAME, null); if (fallbackDefaultBrowserPackageName != null) { try { ApplicationInfo applicationInfo = packageManager .getApplicationInfo(fallbackDefaultBrowserPackageName, 0); String defaultBrowserLabel = packageManager.getApplicationLabel(applicationInfo).toString(); if (defaultBrowserPackage == null || !doesPackageExist(packageManager, defaultBrowserPackage)) { SharedPreferences.Editor editor = mSharedPreferences.edit(); editor.putString(PREFERENCE_DEFAULT_BROWSER_LABEL, defaultBrowserLabel); editor.putString(PREFERENCE_DEFAULT_BROWSER_PACKAGE_NAME, fallbackDefaultBrowserPackageName); editor.commit(); } if (leftConsumeBubblePackageName != null && !doesPackageExist(packageManager, leftConsumeBubblePackageName)) { setConsumeBubble(Constant.BubbleAction.ConsumeLeft, Constant.ActionType.View, defaultBrowserLabel, fallbackDefaultBrowserPackageName, fallbackDefaultBrowserActivityClassName); } } catch (PackageManager.NameNotFoundException e) { e.printStackTrace(); } } }
From source file:net.gaast.giggity.ScheduleViewActivity.java
/** Open a link object, either just through the browser or by downloading locally and using a * dedicated viewer./*from w ww. j a v a 2 s. com*/ * @param link Link object - if type is set we'll try to download and use a viewer, unless: * @param allowDownload is set. This also used to avoid infinite loops in case of bugs. */ private void openLink(final Schedule.Link link, boolean allowDownload) { if (link.getType() != null) { Fetcher f = null; try { f = new Fetcher(app, link.getUrl(), Fetcher.Source.CACHE, link.getType()); } catch (IOException e) { // Failure is ~expected so don't make a fuss about it at this stage. :-) } if (f != null) { Uri cached = f.cacheUri(); try { Intent intent = new Intent(); intent.setAction(Intent.ACTION_VIEW); intent.setDataAndType(cached, link.getType()); intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); Log.d("ScheduleViewActivity", "Viewing content externally: " + intent); startActivity(intent); } catch (ActivityNotFoundException e) { new AlertDialog.Builder(ScheduleViewActivity.this).setTitle(R.string.loading_error).setMessage( getString(R.string.no_viewer_error) + " " + link.getType() + ": " + e.getMessage()) .show(); } return; } else if (allowDownload) { final LoadProgress prog = new LoadProgress(this, false); prog.setMessage(getResources().getString(R.string.loading_image)); prog.setDone(new LoadProgressDoneInterface() { @Override public void done() { /* Try again, avoiding inifite-looping on this download just in case. */ openLink(link, false); } }); prog.show(); Thread loader = new Thread() { @Override public void run() { try { Fetcher f = app.fetch(link.getUrl(), Fetcher.Source.ONLINE, link.getType()); f.setProgressHandler(prog.getHandler()); /* Just slurp the entire file into a bogus buffer, what we need is the file in ExternalCacheDir */ byte[] buf = new byte[1024]; //noinspection StatementWithEmptyBody while (f.getStream().read(buf) != -1) { } f.keep(); /* Will trigger the done() above back in the main thread. */ prog.getHandler().sendEmptyMessage(LoadProgress.DONE); } catch (IOException e) { e.printStackTrace(); prog.getHandler().sendMessage(Message.obtain(prog.getHandler(), 0, e)); } } }; loader.start(); return; } } /* If type was not set, or if neither of the two inner ifs were true (do we have the file, or, are we allowed to download it?), fall back to browser. */ Uri uri = Uri.parse(link.getUrl()); Intent browser = new Intent(Intent.ACTION_VIEW, uri); browser.addCategory(Intent.CATEGORY_BROWSABLE); startActivity(browser); }
From source file:com.egloos.hyunyi.musicinfo.LinkPopUp.java
private void displayArtistInfo(JSONObject j) throws JSONException { if (imageLoader == null) imageLoader = ImageLoader.getInstance(); if (!imageLoader.isInited()) imageLoader.init(config);/*from w w w . ja v a 2 s . com*/ Log.i("musicInfo", "LinkPopUp. displayArtistInfo " + j.toString()); //JSONObject j_artist_info = j.getJSONObject("artist"); final String artist_name = j.getString("name"); tArtistName.setText(artist_name); final JSONObject urls = j.optJSONObject("urls"); final JSONArray videos = j.optJSONArray("video"); final JSONArray images = j.optJSONArray("images"); final String msg = artist_name.replaceAll("\\p{Punct}", " ").replaceAll("\\p{Space}", "+"); AsyncHttpClient client = new AsyncHttpClient(); String fmURL = "http://ws.audioscrobbler.com/2.0/?method=artist.getinfo&artist=" + msg + "&autocorrect[1]&format=json&api_key=ca4c10f9ae187ebb889b33ba12da7ee9"; Log.i("musicInfo", fmURL); client.get(fmURL, new AsyncHttpResponseHandler() { @Override public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) { String r = new String(responseBody); ArrayList<String> image_urls = new ArrayList<String>(); try { Log.i("musicInfo", "Communicating with LastFM..."); JSONObject json = new JSONObject(r); Log.i("musicInfo", json.toString()); json = json.getJSONObject("artist"); Log.i("musicInfo", json.toString()); JSONArray artist_images = json.optJSONArray("image"); Log.i("musicInfo", artist_images.toString()); for (int i = 0; i < artist_images.length(); i++) { JSONObject j = artist_images.getJSONObject(i); Log.i("musicInfo", j.optString("size")); if (j.optString("size").contains("extralarge")) { image_urls.add(j.optString("#text")); //b.putString("fm_image", j.getString("#text")); //Log.i("musicInfo", j.getString("#text")); break; } } } catch (JSONException e) { e.printStackTrace(); } if (images != null) { for (int i = 0; i < images.length(); i++) { JSONObject image = null; try { image = images.getJSONObject(i); } catch (JSONException e) { e.printStackTrace(); } int width = image.optInt("width", 0); int height = image.optInt("height", 0); String url = image.optString("url", ""); Log.i("musicInfo", i + ": " + url); if ((width * height > 10000) && (width * height < 100000) && (!url.contains("userserve-ak"))) { //if ((width>300&&width<100)&&(height>300&&height<1000)&&(!url.contains("userserve-ak"))) { image_urls.add(url); Log.i("musicInfo", "Selected: " + url); //available_images.put(image); } } } int random = (int) (Math.random() * image_urls.size()); final String f_url = image_urls.get(random); Log.i("musicInfo", "Total image#=" + image_urls.size() + " Selected image#=" + random + " " + f_url); if (image_urls.size() > 0) { imageLoader.displayImage(f_url, ArtistImage, new ImageLoadingListener() { @Override public void onLoadingStarted(String imageUri, View view) { } @Override public void onLoadingFailed(String imageUri, View view, FailReason failReason) { } @Override public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) { lLinkList.removeAllViews(); //String attr = fImage.optJSONObject("license").optString("attribution"); //tAttribution.setText("Credit. " + ((attr == null) || (attr.contains("n/a")) ? "Unknown" : attr)); if (urls != null) { String[] jsonName = { "wikipedia_url", "mb_url", "lastfm_url", "official_url", "twitter_url" }; for (int i = 0; i < jsonName.length; i++) { if ((urls.optString(jsonName[i]) != null) && (urls.optString(jsonName[i]) != "")) { Log.d("musicinfo", "Link URL: " + urls.optString(jsonName[i])); TextView tv = new TextView(getApplicationContext()); tv.setTextSize(11); tv.setPadding(16, 16, 16, 16); tv.setTextColor(Color.LTGRAY); tv.setTypeface(Typeface.SANS_SERIF); tv.setGravity(Gravity.CENTER_VERTICAL); switch (jsonName[i]) { case "official_url": tv.setText("HOME."); break; case "wikipedia_url": tv.setText("WIKI."); break; case "mb_url": tv.setText("Music Brainz."); break; case "lastfm_url": tv.setText("Last FM."); break; case "twitter_url": tv.setText("Twitter."); break; } try { tv.setTag(urls.getString(jsonName[i])); } catch (JSONException e) { e.printStackTrace(); } tv.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(); intent.setAction(Intent.ACTION_VIEW); intent.addCategory(Intent.CATEGORY_BROWSABLE); intent.setData(Uri.parse((String) v.getTag())); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivity(intent); Toast.makeText(getApplicationContext(), "Open the Link...", Toast.LENGTH_SHORT).show(); //finish(); } }); lLinkList.addView(tv); } } } else { TextView tv = new TextView(getApplicationContext()); tv.setTextSize(11); tv.setPadding(16, 16, 16, 16); tv.setTextColor(Color.LTGRAY); tv.setTypeface(Typeface.SANS_SERIF); tv.setGravity(Gravity.CENTER_VERTICAL); tv.setText("Sorry, No Link Here..."); lLinkList.addView(tv); } if (videos != null) { jVideoArray = videos; mAdapter = new StaggeredViewAdapter(getApplicationContext(), android.R.layout.simple_list_item_1, generateImageData(videos)); //if (mData == null) { mData = generateImageData(videos); //} //mAdapter.clear(); for (JSONObject data : mData) { mAdapter.add(data); } mGridView.setAdapter(mAdapter); } else { } adjBottomColor(((ImageView) view).getDrawable()); } @Override public void onLoadingCancelled(String imageUri, View view) { } }); } else { ArtistImage.setImageResource(R.drawable.lamb_no_image_available); } } @Override public void onFailure(int statusCode, Header[] headers, byte[] responseBody, Throwable error) { } }); }