Android Open Source - Android-Sample-App My Activity






From Project

Back to project page Android-Sample-App.

License

The source code is released under:

End-User License Agreement for Sharethrough Software Product This End-User License Agreement (?EULA??) is a legal agreement between you (either an individual or a single entity) (?the End User?...

If you think the Android project Android-Sample-App 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 com.sharethrough.sample;
// w w  w.  j ava 2s .  c o  m
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class MyActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        Thread.currentThread().setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
            @Override
            public void uncaughtException(Thread thread, Throwable ex) {
                Log.wtf("MEMORY", "uncaught", ex);
            }
        });

        setContentView(R.layout.activity_my);

        ListView menu = (ListView) findViewById(R.id.menu);
        menu.setAdapter(new ArrayAdapter<>(this, R.layout.menu_item, R.id.text, new String[]{
                "Basic", "News Feed w/ Basic View", "Card Style w/ Basic View", "News Feed w/ ListAdapter", "DFP"
        }));
        menu.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) {
                switch (position) {
                    case 0:
                        startActivity(new Intent(MyActivity.this, BasicActivity.class));
                        break;
                    case 1:
                        startActivity(new Intent(MyActivity.this, ListAdapterWithBasicViewActivity.Feed.class));
                        break;
                    case 2:
                        startActivity(new Intent(MyActivity.this, ListAdapterWithBasicViewActivity.Card.class));
                        break;
                    case 3:
                        startActivity(new Intent(MyActivity.this, SharethroughListAdapterActivity.class));
                        break;
                    case 4:
                        startActivity(new Intent(MyActivity.this, DfpActivity.class));
                        break;
                }
            }
        });
    }
}




Java Source Code List

com.sharethrough.SampleApplication.java
com.sharethrough.sample.BasicActivity.java
com.sharethrough.sample.DfpActivity.java
com.sharethrough.sample.FeedItem.java
com.sharethrough.sample.ListAdapterWithBasicViewActivity.java
com.sharethrough.sample.MyActivity.java
com.sharethrough.sample.SharethroughListAdapterActivity.java