package us.bmaupin.test;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class Test extends Activity {
	private static final String TAG = "Test";
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main_with_button);

        Button buttonTest = (Button) findViewById(R.id.button_test);
        buttonTest.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View arg0) {
                Intent i = new Intent(Intent.ACTION_VIEW, 
                        MyProvider.CONTENT_URI);
//                i.putExtra(
//                        "com.googlecode.chartdroid.intent.extra.SERIES_LINE_THICKNESSES", 
//                        new float[] {5f});
                startActivity(i);
                
                
                /*
                 * ACTION_VIEW
                Intent intent = new Intent(ChooseStudySet.this, 
                        ChooseCardGroup.class);
                startActivityForResult(intent, REQUEST_CARD_SET_BROWSE);
                */
            }
        });
        
    }
    
    /* Inflates the menu */
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        MenuInflater inflater = getMenuInflater();
        inflater.inflate(R.menu.menu, menu);
        return true;
    }
    
    /* Handles menu selections */
    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
        case R.id.menu_exit:
            finish();
            return true;
        }
        return false;
    }
}
@@ -19,16 +19,42 @@
 .test;%0A%0A
+import java.util.Arrays;%0A%0A
 import a
@@ -105,16 +105,47 @@
 Intent;%0A
+import android.graphics.Color;%0A
 import a
@@ -162,16 +162,41 @@
 Bundle;%0A
+import android.util.Log;%0A
 import a
@@ -870,24 +870,43 @@
 iew arg0) %7B%0A
+/*                %0A
             
@@ -1488,24 +1488,1205 @@
          */%0A
+                %0A                final String%5B%5D demo_pie_labels = new String%5B%5D %7B%0A                    %22known%22,%0A                    %22iffy%22,%0A                    %22unknown%22%0A                %7D;%0A                final int%5B%5D demo_pie_data = new int%5B%5D %7B12, 5, 3%7D;%0A/*                int%5B%5D colors = new int%5Bdemo_pie_labels.length%5D;%0A                for (int j=0; j%3Cdemo_pie_labels.length; j++)%0A                                colors%5Bj%5D = Color.HSVToColor(new float%5B%5D %7B360 * j / (float) colors.length, 0.6f, 1%7D);%0A                Log.d(TAG, %22colors=%22 + Arrays.toString(colors));%0A*/              %0A                int%5B%5D colors = %7B-10027162, -3276954, -39322%7D;%0A                Intent i = new Intent(%22com.googlecode.chartdroid.intent.action.PLOT%22);%0A                i.addCategory(%22com.googlecode.chartdroid.intent.category.PIE_CHART%22);%0A                i.putExtra(Intent.EXTRA_TITLE, %22Impressions%22);%0A                i.putExtra(%22com.googlecode.chartdroid.intent.extra.LABELS%22, demo_pie_labels);%0A                i.putExtra(%22com.googlecode.chartdroid.intent.extra.DATA%22, demo_pie_data);%0A                i.putExtra(%22com.googlecode.chartdroid.intent.extra.COLORS%22, colors);%0A                startActivity(i);%0A
             

use older, better looking style pie chart