use of android.widget.ListView in project IceNet by anton46.
the class JsonArrayActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final ListView listView = (ListView) findViewById(R.id.list);
final ProgressDialog dialog = new ProgressDialog(this);
dialog.setMessage("Loading...");
dialog.show();
IceNet.connect().createRequest().get().pathUrl("/notes").fromJsonArray().mappingInto(Notes.class).execute("request_string", new RequestCallback<Notes>() {
@Override
public void onRequestSuccess(Notes notes) {
dialog.dismiss();
String[] values = new String[notes.size()];
for (int i = 0; i < notes.size(); i++) values[i] = notes.get(i).getTitle();
adapter = new ArrayAdapter<String>(JsonArrayActivity.this, android.R.layout.simple_list_item_1, android.R.id.text1, values);
listView.setAdapter(adapter);
}
@Override
public void onRequestError(RequestError error) {
dialog.dismiss();
}
});
}
use of android.widget.ListView in project android by cSploit.
the class ExploitFinder method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
SharedPreferences themePrefs = getSharedPreferences("THEME", 0);
Boolean isDark = themePrefs.getBoolean("isDark", false);
if (isDark)
setTheme(R.style.DarkTheme);
else
setTheme(R.style.AppTheme);
super.onCreate(savedInstanceState);
Target t = System.getCurrentTarget();
if (!t.hasOpenPorts())
new FinishDialog(getString(R.string.warning), getString(R.string.no_open_ports), this).show();
else if (!t.hasOpenPortsWithService())
new FinishDialog(getString(R.string.warning), getString(R.string.no_infos_on_target), this).show();
mSearchFloatingActionButton = (FloatingActionButton) findViewById(R.id.searchToggleButton);
mSearchProgress = (ProgressBar) findViewById(R.id.searchActivity);
mListView = (ListView) findViewById(android.R.id.list);
mAdapter = new ExploitAdapter();
UIThread = this;
mListView.setAdapter(mAdapter);
mListView.setOnItemClickListener(listener);
mSearchFloatingActionButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (buttonPlayed) {
setStoppedState();
} else {
setStartedState();
}
}
});
}
use of android.widget.ListView in project android-betterpickers by code-troopers.
the class SampleNumberIntegerListAdapter method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.list);
ListView list = (ListView) findViewById(R.id.list);
list.setAdapter(new SampleAdapter(this, getSupportFragmentManager()));
}
use of android.widget.ListView in project UltimateAndroid by cymcsg.
the class SlideActivityActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.slide_activity_main);
ListView listView = (ListView) findViewById(R.id.list_item);
listView.setAdapter(new SimpleAdapter(this));
listView.setOnItemClickListener(this);
}
use of android.widget.ListView in project UltimateAndroid by cymcsg.
the class SnackbarListViewSampleActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.snack_bar_activity_list_sample);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
final ListView listView = (ListView) findViewById(android.R.id.list);
List<String> data = new ArrayList<String>();
for (int i = 0; i < 25; i++) {
data.add(String.format("Item %d", (i + 1)));
}
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, data);
listView.setAdapter(adapter);
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
SnackbarManager.show(Snackbar.with(SnackbarListViewSampleActivity.this).text(String.format("Item %d pressed", (position + 1))).actionLabel("Close").actionColor(Color.parseColor("#FF8A80")).duration(Snackbar.SnackbarDuration.LENGTH_LONG).attachToAbsListView(listView));
}
});
}
Aggregations