Exemple #1
0
 /* Reload the list of scripts */
 private void scanScripts() {
   try {
     scripts = Script.list(scripts);
     adapter.notifyDataSetChanged();
   } catch (SecurityException se) {
     Toast.makeText(this, "Could not create " + Script.SCRIPTS_DIR, Toast.LENGTH_SHORT);
   }
 }
Exemple #2
0
  private void scriptsListSetUp() {
    tabs.addTab(
        tabs.newTabSpec("tag3")
            .setContent(R.id.tab3)
            .setIndicator(getString(R.string.Scripts_Tab)));

    ListView scriptsList = (ListView) findViewById(R.id.scripts_listview);

    scripts = Script.list();
    adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, scripts);
    scriptsList.setAdapter(adapter);
    TextView emptyView = new TextView(this);
    emptyView.setText(R.string.No_scripts);
    scriptsList.setEmptyView(emptyView);
    scriptsList.setOnItemClickListener(this);
    registerForContextMenu(scriptsList);
  }