use of com.secupwn.aimsicd.data.adapter.SmsDataAdapter in project Android-IMSI-Catcher-Detector by CellularPrivacy.
the class AdvancedUserSmsActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
realm = Realm.getDefaultInstance();
dbaccess = new RealmHelper(getApplicationContext());
RealmResults<SmsData> msgitems = realm.where(SmsData.class).findAllSorted("timestamp");
listViewAdv.setAdapter(new SmsDataAdapter(getApplicationContext(), msgitems, true));
listViewAdv.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() {
@Override
public boolean onItemLongClick(AdapterView<?> a, View v, int position, long id) {
final SmsData smsData = (SmsData) listViewAdv.getItemAtPosition(position);
realm.executeTransaction(new Realm.Transaction() {
@Override
public void execute(Realm realm) {
smsData.removeFromRealm();
}
});
Toast.makeText(a.getContext(), "Deleted Sms", LENGTH_SHORT).show();
return true;
}
});
}
use of com.secupwn.aimsicd.data.adapter.SmsDataAdapter in project Android-IMSI-Catcher-Detector by CellularPrivacy.
the class DbViewerFragment method onViewCreated.
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
DbViewerSpinnerAdapter mSpinnerAdapter = new DbViewerSpinnerAdapter(getActivity(), R.layout.item_spinner_db_viewer);
tblSpinner.setAdapter(mSpinnerAdapter);
tblSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parentView, View selectedItemView, final int position, long id) {
Object selectedItem = tblSpinner.getSelectedItem();
if (!(selectedItem instanceof StatesDbViewer)) {
return;
}
mTableSelected = (StatesDbViewer) selectedItem;
realm.refresh();
switch(position) {
case 0:
setListAdapter(new BaseStationAdapter(getActivity(), realm.allObjects(BaseTransceiverStation.class), true));
break;
case 1:
setListAdapter(new MeasureAdapter(getActivity(), realm.allObjects(Measure.class), true));
break;
case 2:
setListAdapter(new ImportAdapter(getActivity(), realm.allObjects(Import.class), true));
break;
case 3:
setListAdapter(new DefaultLocationAdapter(getActivity(), realm.allObjects(DefaultLocation.class), true));
break;
case // Silent SMS
4:
setListAdapter(new SmsDataAdapter(getActivity(), realm.allObjects(SmsData.class), true));
break;
case 5:
setListAdapter(new MeasuredCellStrengthAdapter(getActivity(), realm.allObjects(Measure.class), true));
break;
case 6:
setListAdapter(new EventAdapter(getActivity(), realm.allObjects(Event.class), true));
break;
case 7:
setListAdapter(new DetectionStringAdapter(getActivity(), realm.allObjects(SmsDetectionString.class), true));
break;
default:
throw new IllegalArgumentException("Unknown type of table");
}
}
@Override
public void onNothingSelected(AdapterView<?> parentView) {
}
});
}
Aggregations