Android Open Source - listmyaps Templates Activity






From Project

Back to project page listmyaps.

License

The source code is released under:

Apache License

If you think the Android project listmyaps listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package de.onyxbits.listmyapps;
/*  w w w.j  a v  a2 s. c o  m*/

import android.os.Bundle;
import android.app.ListActivity;
import android.content.Intent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class TemplatesActivity extends ListActivity {

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_templates);
  }
  
  @Override
  protected void onResume() {
    super.onResume();
    TemplateSource formatsDataSource = new TemplateSource(this);
    formatsDataSource.open();
    ArrayAdapter<TemplateData> adapter = new ArrayAdapter<TemplateData>(this,
        android.R.layout.simple_list_item_1, formatsDataSource.list());
    setListAdapter(adapter);
  }
  
  @Override
  protected void onListItemClick(ListView l, View v, int position, long id) {
    long edit = ((TemplateData)getListAdapter().getItem(position)).id;
    Intent intent = new Intent(this,TemplateEditorActivity.class);
    intent.putExtra(TemplateEditorActivity.EDITID,edit);
    startActivity(intent);
  }

  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.templates, menu);
    return true;
  }

  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
      case R.id.item_add: {
        startActivity(new Intent(this,TemplateEditorActivity.class));
        return true;
      }
    }
    return super.onOptionsItemSelected(item);
  }

}




Java Source Code List

de.onyxbits.listmyapps.AnnotationsActivity.java
de.onyxbits.listmyapps.AnnotationsSource.java
de.onyxbits.listmyapps.AppAdapter.java
de.onyxbits.listmyapps.AppRater.java
de.onyxbits.listmyapps.IconLoaderTask.java
de.onyxbits.listmyapps.ListTask.java
de.onyxbits.listmyapps.MainActivity.java
de.onyxbits.listmyapps.Schema.java
de.onyxbits.listmyapps.SortablePackageInfo.java
de.onyxbits.listmyapps.TagSelectionListener.java
de.onyxbits.listmyapps.TemplateData.java
de.onyxbits.listmyapps.TemplateEditorActivity.java
de.onyxbits.listmyapps.TemplateSource.java
de.onyxbits.listmyapps.TemplatesActivity.java
de.onyxbits.listmyapps.ViewHolder.java