From 8db161017f55a710bd91aa14fe9c1b24d4efdeab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Mon, 11 Feb 2013 17:32:19 +0100 Subject: The newProviderButton gets user to the DialogFragment correctly. The problem in the previous commit was that I had to modify the fragment layout, instead of that of the Activity. I learnt how to obtain and modify it from here: https://developer.android.com/reference/android/app/ListFragment.html --- src/se/leap/leapclient/ProviderListFragment.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/se/leap/leapclient/ProviderListFragment.java b/src/se/leap/leapclient/ProviderListFragment.java index d83a7bc1..bde3baac 100644 --- a/src/se/leap/leapclient/ProviderListFragment.java +++ b/src/se/leap/leapclient/ProviderListFragment.java @@ -1,9 +1,14 @@ package se.leap.leapclient; import android.app.Activity; +import android.app.DialogFragment; +import android.app.Fragment; +import android.app.FragmentTransaction; import android.app.ListFragment; import android.os.Bundle; +import android.view.LayoutInflater; import android.view.View; +import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.ListView; @@ -63,7 +68,7 @@ public class ProviderListFragment extends ListFragment { */ public ProviderListFragment() { } - + @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -73,8 +78,14 @@ public class ProviderListFragment extends ListFragment { android.R.layout.simple_list_item_activated_1, android.R.id.text1, ProviderListContent.ITEMS)); + } + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle bundle) { + return inflater.inflate(R.layout.provider_list_fragment, container, false); + } + @Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); -- cgit v1.2.3