summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/profiles/triggers/BluetoothTriggerFragment.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/settings/profiles/triggers/BluetoothTriggerFragment.java')
-rw-r--r--src/com/android/settings/profiles/triggers/BluetoothTriggerFragment.java30
1 files changed, 29 insertions, 1 deletions
diff --git a/src/com/android/settings/profiles/triggers/BluetoothTriggerFragment.java b/src/com/android/settings/profiles/triggers/BluetoothTriggerFragment.java
index e2967de..5f3e3b1 100644
--- a/src/com/android/settings/profiles/triggers/BluetoothTriggerFragment.java
+++ b/src/com/android/settings/profiles/triggers/BluetoothTriggerFragment.java
@@ -22,8 +22,10 @@ import android.bluetooth.BluetoothClass;
import android.bluetooth.BluetoothDevice;
import android.content.Context;
import android.content.DialogInterface;
+import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
+import android.provider.Settings;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -36,6 +38,7 @@ import cyanogenmod.app.Profile;
import cyanogenmod.app.ProfileManager;
import com.android.settings.R;
+import com.android.settings.Utils;
import com.android.settings.profiles.ProfilesSettings;
import java.util.ArrayList;
@@ -50,6 +53,8 @@ public class BluetoothTriggerFragment extends ListFragment {
Profile mProfile;
ProfileManager mProfileManager;
+ private View mEmptyView;
+
private List<BluetoothTrigger> mTriggers = new ArrayList<BluetoothTrigger>();
private BluetoothTriggerAdapter mListAdapter;
@@ -153,12 +158,35 @@ public class BluetoothTriggerFragment extends ListFragment {
}
@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 bluetoothSettings = new Intent();
+ bluetoothSettings.setAction(
+ Settings.ACTION_BLUETOOTH_SETTINGS);
+ startActivity(bluetoothSettings);
+ }
+ });
+
+ ViewGroup view = (ViewGroup) super.onCreateView(inflater, container, savedInstanceState);
+ view.addView(mEmptyView);
+ return view;
+ }
+
+ @Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
reloadTriggerListItems();
mListAdapter = new BluetoothTriggerAdapter(getActivity());
setListAdapter(mListAdapter);
- setEmptyText(getString(R.string.no_bluetooth_triggers));
}
private void removeTrigger(List<Trigger> triggers, int value) {