Fix deadood issue
This commit is contained in:
parent
5f095ec617
commit
329a2348fc
2 changed files with 8 additions and 10 deletions
|
@ -49,7 +49,7 @@
|
||||||
android:id="@+id/statusText"
|
android:id="@+id/statusText"
|
||||||
android:text="@string/status_not_connected"
|
android:text="@string/status_not_connected"
|
||||||
android:textColor="@android:color/white"
|
android:textColor="@android:color/white"
|
||||||
android:textSize="20dp"
|
android:textSize="18dp"
|
||||||
android:paddingLeft="5dp"
|
android:paddingLeft="5dp"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
@ -88,7 +88,7 @@
|
||||||
android:id="@+id/exit"
|
android:id="@+id/exit"
|
||||||
android:text="@string/menu_exit"
|
android:text="@string/menu_exit"
|
||||||
android:textColor="@android:color/white"
|
android:textColor="@android:color/white"
|
||||||
android:textSize="20dp"
|
android:textSize="18dp"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
|
|
@ -141,7 +141,7 @@ public class StatusFragment extends Fragment {
|
||||||
|
|
||||||
private void populateSliderContent() {
|
private void populateSliderContent() {
|
||||||
if (LinphoneManager.isInstanciated() && LinphoneManager.getLc() != null) {
|
if (LinphoneManager.isInstanciated() && LinphoneManager.getLc() != null) {
|
||||||
AccountsListAdapter adapter = new AccountsListAdapter(LinphoneManager.getLc().getProxyConfigList());
|
AccountsListAdapter adapter = new AccountsListAdapter();
|
||||||
sliderContent.setAdapter(adapter);
|
sliderContent.setAdapter(adapter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -325,12 +325,10 @@ public class StatusFragment extends Fragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
class AccountsListAdapter extends BaseAdapter {
|
class AccountsListAdapter extends BaseAdapter {
|
||||||
private LinphoneProxyConfig[] accounts;
|
|
||||||
private SharedPreferences prefs;
|
private SharedPreferences prefs;
|
||||||
private List<CheckBox> checkboxes;
|
private List<CheckBox> checkboxes;
|
||||||
|
|
||||||
AccountsListAdapter(LinphoneProxyConfig[] lpcs) {
|
AccountsListAdapter() {
|
||||||
accounts = lpcs;
|
|
||||||
prefs = PreferenceManager.getDefaultSharedPreferences(getActivity());
|
prefs = PreferenceManager.getDefaultSharedPreferences(getActivity());
|
||||||
checkboxes = new ArrayList<CheckBox>();
|
checkboxes = new ArrayList<CheckBox>();
|
||||||
}
|
}
|
||||||
|
@ -354,7 +352,7 @@ public class StatusFragment extends Fragment {
|
||||||
checkBox.setEnabled(false);
|
checkBox.setEnabled(false);
|
||||||
|
|
||||||
LinphoneCore lc = LinphoneManager.getLc();
|
LinphoneCore lc = LinphoneManager.getLc();
|
||||||
lc.setDefaultProxyConfig(accounts[selectedPosition]);
|
lc.setDefaultProxyConfig((LinphoneProxyConfig) getItem(selectedPosition));
|
||||||
if (lc.isNetworkReachable()) {
|
if (lc.isNetworkReachable()) {
|
||||||
lc.refreshRegisters();
|
lc.refreshRegisters();
|
||||||
}
|
}
|
||||||
|
@ -363,11 +361,11 @@ public class StatusFragment extends Fragment {
|
||||||
};
|
};
|
||||||
|
|
||||||
public int getCount() {
|
public int getCount() {
|
||||||
return accounts.length;
|
return LinphoneManager.getLc().getProxyConfigList().length;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object getItem(int position) {
|
public Object getItem(int position) {
|
||||||
return accounts[position];
|
return LinphoneManager.getLc().getProxyConfigList()[position];
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getItemId(int position) {
|
public long getItemId(int position) {
|
||||||
|
|
Loading…
Reference in a new issue