diff options
Diffstat (limited to 'src/com/android/settings/profiles/triggers/WifiTriggerFragment.java')
-rw-r--r-- | src/com/android/settings/profiles/triggers/WifiTriggerFragment.java | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/com/android/settings/profiles/triggers/WifiTriggerFragment.java b/src/com/android/settings/profiles/triggers/WifiTriggerFragment.java index c34808d..93ef233 100644 --- a/src/com/android/settings/profiles/triggers/WifiTriggerFragment.java +++ b/src/com/android/settings/profiles/triggers/WifiTriggerFragment.java @@ -19,10 +19,12 @@ import android.app.AlertDialog; import android.app.ListFragment; import android.content.Context; import android.content.DialogInterface; +import android.content.Intent; import android.content.res.Resources; import android.net.wifi.WifiConfiguration; import android.net.wifi.WifiManager; import android.os.Bundle; +import android.provider.Settings; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -45,6 +47,8 @@ public class WifiTriggerFragment extends ListFragment { Profile mProfile; private ProfileManager mProfileManager; + private View mEmptyView; + private List<WifiTrigger> mTriggers = new ArrayList<WifiTrigger>(); private WifiTriggerAdapter mListAdapter; @@ -74,6 +78,31 @@ public class WifiTriggerFragment extends ListFragment { mWifiManager = (WifiManager) getActivity().getSystemService(Context.WIFI_SERVICE); } + + @Override + public void onStart() { + super.onStart(); + getListView().setEmptyView(mEmptyView); + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + mEmptyView = inflater.inflate(R.layout.profile_bluetooth_empty_view, container, false); + mEmptyView.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent wifiSettings = new Intent(); + wifiSettings.setAction( + Settings.ACTION_WIFI_SETTINGS); + startActivity(wifiSettings); + } + }); + + ViewGroup view = (ViewGroup) super.onCreateView(inflater, container, savedInstanceState); + view.addView(mEmptyView); + return view; + } + @Override public void onResume() { super.onResume(); |