Skip to content
Snippets Groups Projects
Commit 9124cb18 authored by Shubham Maheshwari's avatar Shubham Maheshwari
Browse files

added getting bookmarks from the database

parent f274fed5
No related branches found
No related tags found
No related merge requests found
...@@ -72,7 +72,12 @@ public class DashboardFragment extends Fragment { ...@@ -72,7 +72,12 @@ public class DashboardFragment extends Fragment {
@Override @Override
public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) { public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) {
String selectedbookmark = bookmarks.get(position); String selectedbookmark = bookmarks.get(position);
String URL = "http://"+bookmarkdetails.get(selectedbookmark); String URL;
if (bookmarkdetails.get(selectedbookmark).contains("http://") || bookmarkdetails.get(selectedbookmark).contains("http://")){
URL = bookmarkdetails.get(selectedbookmark);
} else {
URL = "http://"+bookmarkdetails.get(selectedbookmark);
}
Toast.makeText(getActivity().getApplicationContext(), "Bookmark selected: "+selectedbookmark, Toast.LENGTH_SHORT).show(); Toast.makeText(getActivity().getApplicationContext(), "Bookmark selected: "+selectedbookmark, Toast.LENGTH_SHORT).show();
Uri uri = Uri.parse(URL); Uri uri = Uri.parse(URL);
Intent BrowserIntent = new Intent(Intent.ACTION_VIEW,uri); Intent BrowserIntent = new Intent(Intent.ACTION_VIEW,uri);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment