From 17be8fb3f7a4cf75149ddedd825a629e1f994ea8 Mon Sep 17 00:00:00 2001 From: str4d <str4d@mail.i2p> Date: Sat, 10 Aug 2013 00:50:10 +0000 Subject: [PATCH] Load WebFragment properly from AddressbookFragment --- .../android/router/fragment/AddressbookFragment.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/net/i2p/android/router/fragment/AddressbookFragment.java b/src/net/i2p/android/router/fragment/AddressbookFragment.java index e8bf624ca..ed8a7fcf3 100644 --- a/src/net/i2p/android/router/fragment/AddressbookFragment.java +++ b/src/net/i2p/android/router/fragment/AddressbookFragment.java @@ -76,9 +76,15 @@ public class AddressbookFragment extends Fragment { lv.setOnItemClickListener(new AdapterView.OnItemClickListener() { public void onItemClick(AdapterView parent, View view, int pos, long id) { CharSequence host = ((TextView) view).getText(); - Intent intent = new Intent(view.getContext(), WebFragment.class); - intent.setData(Uri.parse("http://" + host + '/')); - startActivity(intent); + WebFragment f = new WebFragment(); + Bundle args = new Bundle(); + args.putString(WebFragment.HTML_URI, "http://" + host + '/'); + f.setArguments(args); + getActivity().getSupportFragmentManager() + .beginTransaction() + .replace(R.id.main_content, f) + .addToBackStack(null) + .commit(); } }); -- GitLab