Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
Premium Land with House for Sale
anil1961
Updated:
Yesterday at 10:15 AM
AWS Certified Solutions Architect-Associate + AWS Certified Cloud Practitioner
Sanjeewani95
Updated:
Wednesday at 8:16 PM
🚀 එක පැකේජ් එකයි - මාසෙටම Unlimited Internet! 🌐
sayuru bandara
Updated:
Tuesday at 10:57 AM
🎬 CapCut Pro 1 Month Access! LKR 600
sayuru bandara
Updated:
Tuesday at 10:55 AM
🚀 Google One AI PRO Plan (Gemini Pro Activation) – 18 Months Access! LKR 2200
sayuru bandara
Updated:
Tuesday at 10:53 AM
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri Help
android expert ලා එන්න .
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="san1020" data-source="post: 13789008" data-attributes="member: 360234"><p><span style="font-size: 15px">Main<span style="font-size: 15px">Activity eke </span>onCreate eke thiyena awla mokakda ?????? <img src="/styles/default/xenforo/smilies/default/sad.gif" class="smilie" loading="lazy" alt=":(" title="Sad :(" data-shortname=":(" /></span></p><p></p><p></p><p>[CODE]package com.example.chart;</p><p></p><p>import java.text.Collator;</p><p>import java.util.ArrayList;</p><p>import java.util.Collections;</p><p>import java.util.Comparator;</p><p>import java.util.HashMap;</p><p>import java.util.List;</p><p>import java.util.Map;</p><p>import android.app.Activity;</p><p>import android.content.Intent;</p><p>import android.content.pm.PackageManager;</p><p>import android.content.pm.ResolveInfo;</p><p>import android.os.Bundle;</p><p>import android.view.Window;</p><p></p><p>/**</p><p> * ChartHierarchyActivity</p><p> */</p><p>public class MainActivity extends Activity {</p><p></p><p> private final String TARGET_PACKAGE_NAME = "org.afree.chart";</p><p></p><p> public static final String CTEGORY_NAME = "org.afree.chart.demo";</p><p></p><p> /**</p><p> * Called when the activity is starting.</p><p> * @param savedInstanceState</p><p> */</p><p> @Override</p><p>protected void onCreate(Bundle savedInstanceState) {</p><p> // TODO Auto-generated method stub</p><p> </p><p> super.onCreate(savedInstanceState);</p><p></p><p> mybarchart mView = new mybarchart(this);</p><p> requestWindowFeature(Window.FEATURE_NO_TITLE);</p><p> setContentView(mView);</p><p> </p><p>}</p><p> [/CODE]</p><p></p><p></p><p>[CODE]11-06 11:49:18.420: E/AndroidRuntime(809): FATAL EXCEPTION: main</p><p>11-06 11:49:18.420: E/AndroidRuntime(809): java.lang.NoClassDefFoundError: com.example.chart.mybarchart</p><p>11-06 11:49:18.420: E/AndroidRuntime(809): at com.example.chart.MainActivity.onCreate(MainActivity.java:37)</p><p>11-06 11:49:18.420: E/AndroidRuntime(809): at android.app.Activity.performCreate(Activity.java:5008)</p><p>11-06 11:49:18.420: E/AndroidRuntime(809): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)</p><p>11-06 11:49:18.420: E/AndroidRuntime(809): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)</p><p>11-06 11:49:18.420: E/AndroidRuntime(809): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)</p><p>11-06 11:49:18.420: E/AndroidRuntime(809): at android.app.ActivityThread.access$600(ActivityThread.java:130)</p><p>11-06 11:49:18.420: E/AndroidRuntime(809): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)</p><p>11-06 11:49:18.420: E/AndroidRuntime(809): at android.os.Handler.dispatchMessage(Handler.java:99)</p><p>11-06 11:49:18.420: E/AndroidRuntime(809): at android.os.Looper.loop(Looper.java:137)</p><p>11-06 11:49:18.420: E/AndroidRuntime(809): at android.app.ActivityThread.main(ActivityThread.java:4745)</p><p>11-06 11:49:18.420: E/AndroidRuntime(809): at java.lang.reflect.Method.invokeNative(Native Method)</p><p>11-06 11:49:18.420: E/AndroidRuntime(809): at java.lang.reflect.Method.invoke(Method.java:511)</p><p>11-06 11:49:18.420: E/AndroidRuntime(809): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)</p><p>11-06 11:49:18.420: E/AndroidRuntime(809): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)</p><p>11-06 11:49:18.420: E/AndroidRuntime(809): at dalvik.system.NativeStart.main(Native Method)</p><p>[/CODE]</p><p></p><p>[CODE]/* ===========================================================</p><p> * AFreeChart : a free chart library for Android(tm) platform.</p><p> * (based on JFreeChart and JCommon)</p><p> * ===========================================================</p><p> *</p><p> * (C) Copyright 2010, by ICOMSYSTECH Co.,Ltd.</p><p> * (C) Copyright 2000-2008, by Object Refinery Limited and Contributors.</p><p> *</p><p> * Project Info:</p><p> * AFreeChart: http://code.google.com/p/afreechart/</p><p> * JFreeChart: http://www.jfree.org/jfreechart/index.html</p><p> * JCommon : http://www.jfree.org/jcommon/index.html</p><p> *</p><p> * This program is free software: you can redistribute it and/or modify</p><p> * it under the terms of the GNU Lesser General Public License as published by</p><p> * the Free Software Foundation, either version 3 of the License, or</p><p> * (at your option) any later version.</p><p> * </p><p> * This program is distributed in the hope that it will be useful,</p><p> * but WITHOUT ANY WARRANTY; without even the implied warranty of</p><p> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</p><p> * GNU Lesser General Public License for more details.</p><p> * </p><p> * You should have received a copy of the GNU Lesser General Public License</p><p> * along with this program. If not, see <http://www.gnu.org/licenses/>.</p><p> *</p><p> * [Android is a trademark of Google Inc.]</p><p> *</p><p> * -----------------</p><p> * BarChartDemo01View.java</p><p> * -----------------</p><p> * (C) Copyright 2010, 2011, by ICOMSYSTECH Co.,Ltd.</p><p> *</p><p> * Original Author: Niwano Masayoshi (for ICOMSYSTECH Co.,Ltd);</p><p> * Contributor(s): -;</p><p> *</p><p> * Changes</p><p> * -------</p><p> * 19-Nov-2010 : Version 0.0.1 (NM);</p><p> */</p><p></p><p>package com.example.chart;</p><p></p><p></p><p>import org.afree.chart.ChartFactory;</p><p>import org.afree.chart.AFreeChart;</p><p>import org.afree.chart.axis.CategoryAxis;</p><p>import org.afree.chart.axis.CategoryLabelPositions;</p><p>import org.afree.chart.axis.NumberAxis;</p><p>import org.afree.chart.plot.CategoryPlot;</p><p>import org.afree.chart.plot.PlotOrientation;</p><p>import org.afree.chart.renderer.category.BarRenderer;</p><p>import org.afree.data.category.CategoryDataset;</p><p>import org.afree.data.category.DefaultCategoryDataset;</p><p>import org.afree.graphics.GradientColor;</p><p>import org.afree.graphics.SolidColor;</p><p></p><p>import android.content.Context;</p><p>import android.graphics.Color;</p><p></p><p>/**</p><p> * BarChartDemo01View</p><p> */</p><p>public class mybarchart extends DemoView {</p><p></p><p> /**</p><p> * constructor</p><p> * @param context</p><p> */</p><p> public mybarchart(Context context) {</p><p> super(context);</p><p></p><p> CategoryDataset dataset = createDataset();</p><p> AFreeChart chart = createChart(dataset);</p><p></p><p> setChart(chart);</p><p> }</p><p></p><p> /**</p><p> * Returns a sample dataset.</p><p> *</p><p> * @return The dataset.</p><p> */</p><p> private static CategoryDataset createDataset() {</p><p></p><p> // row keys...</p><p> String series1 = "First";</p><p> String series2 = "Second";</p><p> String series3 = "Third";</p><p></p><p> // column keys...</p><p> String category1 = "Category 1";</p><p> String category2 = "Category 2";</p><p> String category3 = "Category 3";</p><p> String category4 = "Category 4";</p><p> String category5 = "Category 5";</p><p></p><p> // create the dataset...</p><p> DefaultCategoryDataset dataset = new DefaultCategoryDataset();</p><p></p><p> dataset.addValue(1.0, series1, category1);</p><p> dataset.addValue(4.0, series1, category2);</p><p> dataset.addValue(3.0, series1, category3);</p><p> dataset.addValue(5.0, series1, category4);</p><p> dataset.addValue(5.0, series1, category5);</p><p></p><p> dataset.addValue(5.0, series2, category1);</p><p> dataset.addValue(7.0, series2, category2);</p><p> dataset.addValue(6.0, series2, category3);</p><p> dataset.addValue(8.0, series2, category4);</p><p> dataset.addValue(4.0, series2, category5);</p><p></p><p> dataset.addValue(4.0, series3, category1);</p><p> dataset.addValue(3.0, series3, category2);</p><p> dataset.addValue(2.0, series3, category3);</p><p> dataset.addValue(3.0, series3, category4);</p><p> dataset.addValue(6.0, series3, category5);</p><p></p><p> return dataset;</p><p></p><p> }</p><p></p><p> /**</p><p> * Creates a sample chart.</p><p> *</p><p> * @param dataset the dataset.</p><p> *</p><p> * @return The chart.</p><p> */</p><p> private static AFreeChart createChart(CategoryDataset dataset) {</p><p></p><p> // create the chart...</p><p> AFreeChart chart = ChartFactory.createBarChart(</p><p> "Bar Chart Demo 01", // chart title</p><p> "Category", // domain axis label</p><p> "Value", // range axis label</p><p> dataset, // data</p><p> PlotOrientation.VERTICAL, // orientation</p><p> true, // include legend</p><p> true, // tooltips?</p><p> false // URLs?</p><p> );</p><p></p><p> // NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART...</p><p></p><p> // set the background color for the chart...</p><p> chart.setBackgroundPaintType(new SolidColor(Color.WHITE));</p><p></p><p> // get a reference to the plot for further customisation...</p><p> CategoryPlot plot = (CategoryPlot) chart.getPlot();</p><p></p><p> // set the range axis to display integers only...</p><p> NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();</p><p> rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());</p><p></p><p> // disable bar outlines...</p><p> BarRenderer renderer = (BarRenderer) plot.getRenderer();</p><p> renderer.setDrawBarOutline(false);</p><p></p><p> // set up gradient paints for series...</p><p> GradientColor gp0 = new GradientColor(Color.BLUE, Color.rgb(0, 0, 64));</p><p> GradientColor gp1 = new GradientColor(Color.GREEN, Color.rgb(0, 64, 0));</p><p> GradientColor gp2 = new GradientColor(Color.RED, Color.rgb(64, 0, 0));</p><p> renderer.setSeriesPaintType(0, gp0);</p><p> renderer.setSeriesPaintType(1, gp1);</p><p> renderer.setSeriesPaintType(2, gp2);</p><p></p><p> CategoryAxis domainAxis = plot.getDomainAxis();</p><p> domainAxis.setCategoryLabelPositions(</p><p> CategoryLabelPositions.createUpRotationLabelPositions(</p><p> Math.PI / 6.0));</p><p> // OPTIONAL CUSTOMISATION COMPLETED.</p><p></p><p> return chart;</p><p></p><p> }</p><p>}</p><p>[/CODE]</p></blockquote><p></p>
[QUOTE="san1020, post: 13789008, member: 360234"] [SIZE=4]Main[SIZE=4]Activity eke [/SIZE]onCreate eke thiyena awla mokakda ?????? :([/SIZE] [CODE]package com.example.chart; import java.text.Collator; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.List; import java.util.Map; import android.app.Activity; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.os.Bundle; import android.view.Window; /** * ChartHierarchyActivity */ public class MainActivity extends Activity { private final String TARGET_PACKAGE_NAME = "org.afree.chart"; public static final String CTEGORY_NAME = "org.afree.chart.demo"; /** * Called when the activity is starting. * @param savedInstanceState */ @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); mybarchart mView = new mybarchart(this); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(mView); } [/CODE] [CODE]11-06 11:49:18.420: E/AndroidRuntime(809): FATAL EXCEPTION: main 11-06 11:49:18.420: E/AndroidRuntime(809): java.lang.NoClassDefFoundError: com.example.chart.mybarchart 11-06 11:49:18.420: E/AndroidRuntime(809): at com.example.chart.MainActivity.onCreate(MainActivity.java:37) 11-06 11:49:18.420: E/AndroidRuntime(809): at android.app.Activity.performCreate(Activity.java:5008) 11-06 11:49:18.420: E/AndroidRuntime(809): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079) 11-06 11:49:18.420: E/AndroidRuntime(809): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023) 11-06 11:49:18.420: E/AndroidRuntime(809): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084) 11-06 11:49:18.420: E/AndroidRuntime(809): at android.app.ActivityThread.access$600(ActivityThread.java:130) 11-06 11:49:18.420: E/AndroidRuntime(809): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195) 11-06 11:49:18.420: E/AndroidRuntime(809): at android.os.Handler.dispatchMessage(Handler.java:99) 11-06 11:49:18.420: E/AndroidRuntime(809): at android.os.Looper.loop(Looper.java:137) 11-06 11:49:18.420: E/AndroidRuntime(809): at android.app.ActivityThread.main(ActivityThread.java:4745) 11-06 11:49:18.420: E/AndroidRuntime(809): at java.lang.reflect.Method.invokeNative(Native Method) 11-06 11:49:18.420: E/AndroidRuntime(809): at java.lang.reflect.Method.invoke(Method.java:511) 11-06 11:49:18.420: E/AndroidRuntime(809): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) 11-06 11:49:18.420: E/AndroidRuntime(809): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 11-06 11:49:18.420: E/AndroidRuntime(809): at dalvik.system.NativeStart.main(Native Method) [/CODE] [CODE]/* =========================================================== * AFreeChart : a free chart library for Android(tm) platform. * (based on JFreeChart and JCommon) * =========================================================== * * (C) Copyright 2010, by ICOMSYSTECH Co.,Ltd. * (C) Copyright 2000-2008, by Object Refinery Limited and Contributors. * * Project Info: * AFreeChart: http://code.google.com/p/afreechart/ * JFreeChart: http://www.jfree.org/jfreechart/index.html * JCommon : http://www.jfree.org/jcommon/index.html * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * * [Android is a trademark of Google Inc.] * * ----------------- * BarChartDemo01View.java * ----------------- * (C) Copyright 2010, 2011, by ICOMSYSTECH Co.,Ltd. * * Original Author: Niwano Masayoshi (for ICOMSYSTECH Co.,Ltd); * Contributor(s): -; * * Changes * ------- * 19-Nov-2010 : Version 0.0.1 (NM); */ package com.example.chart; import org.afree.chart.ChartFactory; import org.afree.chart.AFreeChart; import org.afree.chart.axis.CategoryAxis; import org.afree.chart.axis.CategoryLabelPositions; import org.afree.chart.axis.NumberAxis; import org.afree.chart.plot.CategoryPlot; import org.afree.chart.plot.PlotOrientation; import org.afree.chart.renderer.category.BarRenderer; import org.afree.data.category.CategoryDataset; import org.afree.data.category.DefaultCategoryDataset; import org.afree.graphics.GradientColor; import org.afree.graphics.SolidColor; import android.content.Context; import android.graphics.Color; /** * BarChartDemo01View */ public class mybarchart extends DemoView { /** * constructor * @param context */ public mybarchart(Context context) { super(context); CategoryDataset dataset = createDataset(); AFreeChart chart = createChart(dataset); setChart(chart); } /** * Returns a sample dataset. * * @return The dataset. */ private static CategoryDataset createDataset() { // row keys... String series1 = "First"; String series2 = "Second"; String series3 = "Third"; // column keys... String category1 = "Category 1"; String category2 = "Category 2"; String category3 = "Category 3"; String category4 = "Category 4"; String category5 = "Category 5"; // create the dataset... DefaultCategoryDataset dataset = new DefaultCategoryDataset(); dataset.addValue(1.0, series1, category1); dataset.addValue(4.0, series1, category2); dataset.addValue(3.0, series1, category3); dataset.addValue(5.0, series1, category4); dataset.addValue(5.0, series1, category5); dataset.addValue(5.0, series2, category1); dataset.addValue(7.0, series2, category2); dataset.addValue(6.0, series2, category3); dataset.addValue(8.0, series2, category4); dataset.addValue(4.0, series2, category5); dataset.addValue(4.0, series3, category1); dataset.addValue(3.0, series3, category2); dataset.addValue(2.0, series3, category3); dataset.addValue(3.0, series3, category4); dataset.addValue(6.0, series3, category5); return dataset; } /** * Creates a sample chart. * * @param dataset the dataset. * * @return The chart. */ private static AFreeChart createChart(CategoryDataset dataset) { // create the chart... AFreeChart chart = ChartFactory.createBarChart( "Bar Chart Demo 01", // chart title "Category", // domain axis label "Value", // range axis label dataset, // data PlotOrientation.VERTICAL, // orientation true, // include legend true, // tooltips? false // URLs? ); // NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART... // set the background color for the chart... chart.setBackgroundPaintType(new SolidColor(Color.WHITE)); // get a reference to the plot for further customisation... CategoryPlot plot = (CategoryPlot) chart.getPlot(); // set the range axis to display integers only... NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis(); rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); // disable bar outlines... BarRenderer renderer = (BarRenderer) plot.getRenderer(); renderer.setDrawBarOutline(false); // set up gradient paints for series... GradientColor gp0 = new GradientColor(Color.BLUE, Color.rgb(0, 0, 64)); GradientColor gp1 = new GradientColor(Color.GREEN, Color.rgb(0, 64, 0)); GradientColor gp2 = new GradientColor(Color.RED, Color.rgb(64, 0, 0)); renderer.setSeriesPaintType(0, gp0); renderer.setSeriesPaintType(1, gp1); renderer.setSeriesPaintType(2, gp2); CategoryAxis domainAxis = plot.getDomainAxis(); domainAxis.setCategoryLabelPositions( CategoryLabelPositions.createUpRotationLabelPositions( Math.PI / 6.0)); // OPTIONAL CUSTOMISATION COMPLETED. return chart; } } [/CODE] [/QUOTE]
Insert quotes…
Verification
Dawasata paya keeyak thibeda?
Post reply
Top
Bottom