Search in sources :

Example 1 with ListView

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();
        }
    });
}
Also used : ListView(android.widget.ListView) RequestError(labs.anton.icenet.RequestError) ProgressDialog(android.app.ProgressDialog) ArrayAdapter(android.widget.ArrayAdapter)

Example 2 with ListView

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();
            }
        }
    });
}
Also used : Target(org.csploit.android.net.Target) SharedPreferences(android.content.SharedPreferences) FinishDialog(org.csploit.android.gui.dialogs.FinishDialog) OnClickListener(android.view.View.OnClickListener) ImageView(android.widget.ImageView) View(android.view.View) AdapterView(android.widget.AdapterView) TextView(android.widget.TextView) ListView(android.widget.ListView)

Example 3 with ListView

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()));
}
Also used : ListView(android.widget.ListView)

Example 4 with ListView

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);
}
Also used : ListView(android.widget.ListView)

Example 5 with ListView

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));
        }
    });
}
Also used : ArrayList(java.util.ArrayList) View(android.view.View) AdapterView(android.widget.AdapterView) ListView(android.widget.ListView) ListView(android.widget.ListView) AdapterView(android.widget.AdapterView) ArrayAdapter(android.widget.ArrayAdapter)

Aggregations

ListView (android.widget.ListView)1104 View (android.view.View)714 AdapterView (android.widget.AdapterView)425 TextView (android.widget.TextView)371 ImageView (android.widget.ImageView)163 Intent (android.content.Intent)144 AbsListView (android.widget.AbsListView)134 OnItemClickListener (android.widget.AdapterView.OnItemClickListener)93 ArrayAdapter (android.widget.ArrayAdapter)93 ArrayList (java.util.ArrayList)80 ViewGroup (android.view.ViewGroup)70 ListAdapter (android.widget.ListAdapter)70 OnClickListener (android.view.View.OnClickListener)65 LayoutInflater (android.view.LayoutInflater)59 Bundle (android.os.Bundle)57 Button (android.widget.Button)55 LinearLayout (android.widget.LinearLayout)47 SuppressLint (android.annotation.SuppressLint)34 DialogInterface (android.content.DialogInterface)32 ScrollView (android.widget.ScrollView)31