Android Open Source - MailNet_Android Newsfeed Activity






From Project

Back to project page MailNet_Android.

License

The source code is released under:

MIT License

If you think the Android project MailNet_Android 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 org.lf_net.mailnet;
//from   w ww .  j ava 2  s.  com
import org.lf_net.mailnet.PostAdapter.Post;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.ListView;

public class NewsfeedActivity extends Activity {
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_newsfeed);
    
    PostAdapter adapter = new PostAdapter(this);
    ((ListView)findViewById(R.id.listView1)).setAdapter(adapter);
    
    
    
    for(int i = 0; i < 100; i++)
      adapter.addItem(new Post("bla" + String.valueOf(i), "01-01-1970", "littefox@lf-net.org"));
  }

  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.newsfeed, menu);
    return true;
  }
  
  public void actionSettings_onClick(MenuItem item) {
    Intent intent = new Intent(getApplicationContext(), SettingsActivity.class);
    startActivity(intent);
    
  }
  
  public void actionWrite_onClick(MenuItem item) {
    Intent intent = new Intent(getApplicationContext(), WriteActivity.class);
    startActivity(intent);
    
  }

}




Java Source Code List

org.lf_net.mailnet.NewsfeedActivity.java
org.lf_net.mailnet.PostAdapter.java
org.lf_net.mailnet.SettingsActivity.java