Kişisel Sayfaları
İlgi Alanları
İş Tecrubesi
Eğitim Geçmişi
Sertifikalar & Başarılar
Kullanıcıya ait test sonucu bulunmamaktadır.
Dil Becerileri
Son Forum Aktiviteleri
13dinamik kontrol silmek
LinearLayoutun içine dinamik kontroller ekliyorum fakat silmem de gerekiyor ama silemiyorum. Yardım eder misiniz?
removeAllViews
[code]while(reset.next()){ LinearLayout yeni = new LinearLayout(MSSQLUygulamasiActivity.this); TextView btn= new TextView(MSSQLUygulamasiActivity.this); btn.setText(reset.getString(2)); btn.setWidth(400); btn.setTextSize(20); TextView txt = new TextView(MSSQLUygulamasiActivity.this); txt.setText(reset.getString(3)); txt.setTextSize(20); txt.setWidth(400); ImageView img = new ImageView(MSSQLUygulamasiActivity.this); Bitmap bitmap = BitmapFactory.decodeStream((InputStream)new URL(reset.getString(4)).getContent()); img.setImageBitmap(bitmap); CheckBox chack = new CheckBox(MSSQLUygulamasiActivity.this); chack.setTag(reset.getString(1)); chack.setTextSize(20); if( reset.getInt(5)==1) { chack.setChecked(true); } yeni.addView(img); yeni.addView(btn); yeni.addView(txt); yeni.addView(chack); [/code]
şekilin de LinearLayoutu dolduruyorum.
checkbox işaretliyse stokta olanlar değilse olmayanlar geliyor. fakat LinearLayoutun içindekileri silemedim durmadan altına ekliyor
removeAllViews denediğimdede program kırılıyor logcat çıktışı aşağıdaki gibi:
[code]02-11 09:55:19.345: W/IInputConnectionWrapper(1511): showStatusIcon on inactive InputConnection 02-11 09:55:23.555: I/Choreographer(1511): Skipped 85 frames! The application may be doing too much work on its main thread. 02-11 09:55:27.806: D/dalvikvm(1511): GC_CONCURRENT freed 324K, 5% free 9231K/9680K, paused 9ms+51ms, total 278ms 02-11 09:55:27.806: D/dalvikvm(1511): WAIT_FOR_CONCURRENT_GC blocked 62ms 02-11 09:55:35.498: D/dalvikvm(1511): null clazz in OP_INSTANCE_OF, single-stepping 02-11 09:55:36.244: D/dalvikvm(1511): GC_FOR_ALLOC freed 6406K, 59% free 4725K/11276K, paused 64ms, total 70ms 02-11 09:55:36.864: D/dalvikvm(1511): GC_FOR_ALLOC freed 139K, 54% free 5232K/11276K, paused 57ms, total 59ms 02-11 09:55:37.704: D/dalvikvm(1511): GC_CONCURRENT freed 174K, 48% free 5879K/11276K, paused 99ms+10ms, total 168ms 02-11 09:55:39.904: I/Choreographer(1511): Skipped 477 frames! The application may be doing too much work on its main thread. 02-11 09:55:40.044: D/dalvikvm(1511): GC_CONCURRENT freed 191K, 41% free 6762K/11276K, paused 98ms+98ms, total 326ms 02-11 09:55:50.975: W/IInputConnectionWrapper(1511): showStatusIcon on inactive InputConnection 02-11 09:55:57.505: I/Choreographer(1511): Skipped 421 frames! The application may be doing too much work on its main thread. 02-11 09:55:58.725: D/dalvikvm(1511): GC_FOR_ALLOC freed 69K, 36% free 7252K/11248K, paused 116ms, total 121ms 02-11 09:55:59.985: I/Choreographer(1511): Skipped 37 frames! The application may be doing too much work on its main thread. 02-11 09:56:04.604: I/Choreographer(1511): Skipped 45 frames! The application may be doing too much work on its main thread. 02-11 09:56:26.185: I/Choreographer(1511): Skipped 60 frames! The application may be doing too much work on its main thread. 02-11 09:56:26.210: D/dalvikvm(1511): GC_CONCURRENT freed 74K, 23% free 8761K/11248K, paused 10ms+90ms, total 286ms 02-11 09:56:35.694: D/dalvikvm(1511): GC_CONCURRENT freed 4443K, 45% free 6266K/11248K, paused 74ms+128ms, total 295ms 02-11 09:56:36.554: I/Choreographer(1511): Skipped 328 frames! The application may be doing too much work on its main thread. 02-11 09:56:43.347: D/dalvikvm(1511): GC_FOR_ALLOC freed 281K, 27% free 7123K/9672K, paused 60ms, total 66ms 02-11 09:56:44.934: D/dalvikvm(1511): GC_CONCURRENT freed 272K, 15% free 8317K/9672K, paused 100ms+110ms, total 307ms 02-11 09:56:46.165: I/Choreographer(1511): Skipped 345 frames! The application may be doing too much work on its main thread. 02-11 09:56:52.615: I/Choreographer(1511): Skipped 31 frames! The application may be doing too much work on its main thread. 02-11 10:00:56.574: E/Trace(1677): error opening trace file: No such file or directory (2) 02-11 10:00:57.484: D/dalvikvm(1677): GC_CONCURRENT freed 54K, 6% free 2837K/3012K, paused 20ms+4ms, total 219ms 02-11 10:00:57.694: D/dalvikvm(1677): GC_FOR_ALLOC freed 21K, 7% free 2955K/3152K, paused 78ms, total 79ms 02-11 10:00:57.724: I/dalvikvm-heap(1677): Grow heap (frag case) to 4.074MB for 1127536-byte allocation 02-11 10:00:57.924: D/dalvikvm(1677): GC_FOR_ALLOC freed <1K, 5% free 4056K/4256K, paused 199ms, total 199ms 02-11 10:00:58.084: D/dalvikvm(1677): GC_CONCURRENT freed <1K, 5% free 4064K/4256K, paused 12ms+23ms, total 160ms 02-11 10:01:14.935: E/Trace(1712): error opening trace file: No such file or directory (2) 02-11 10:01:15.816: D/dalvikvm(1712): GC_CONCURRENT freed 57K, 6% free 2799K/2976K, paused 6ms+28ms, total 156ms 02-11 10:01:16.065: D/dalvikvm(1712): GC_FOR_ALLOC freed 21K, 6% free 2956K/3136K, paused 75ms, total 76ms 02-11 10:01:16.095: I/dalvikvm-heap(1712): Grow heap (frag case) to 4.074MB for 1127536-byte allocation 02-11 10:01:16.205: D/dalvikvm(1712): GC_FOR_ALLOC freed <1K, 5% free 4056K/4240K, paused 107ms, total 107ms 02-11 10:01:16.338: D/dalvikvm(1712): GC_CONCURRENT freed <1K, 5% free 4060K/4240K, paused 7ms+27ms, total 135ms 02-11 10:01:18.124: D/dalvikvm(1712): GC_CONCURRENT freed 207K, 8% free 4299K/4624K, paused 23ms+18ms, total 148ms 02-11 10:01:18.864: I/Choreographer(1712): Skipped 35 frames! The application may be doing too much work on its main thread. 02-11 10:01:19.116: D/gralloc_goldfish(1712): Emulator without GPU emulation detected. 02-11 10:01:28.024: D/AndroidRuntime(1712): Shutting down VM 02-11 10:01:28.024: W/dalvikvm(1712): threadid=1: thread exiting with uncaught exception (group=0x40a71930) 02-11 10:01:28.107: E/AndroidRuntime(1712): FATAL EXCEPTION: main 02-11 10:01:28.107: E/AndroidRuntime(1712): java.lang.NullPointerException 02-11 10:01:28.107: E/AndroidRuntime(1712): at com.MSSQL.MSSQLUygulamasiActivity.ad(MSSQLUygulamasiActivity.java:33) 02-11 10:01:28.107: E/AndroidRuntime(1712): at com.MSSQL.MSSQLUygulamasiActivity.access$0(MSSQLUygulamasiActivity.java:32) 02-11 10:01:28.107: E/AndroidRuntime(1712): at com.MSSQL.MSSQLUygulamasiActivity$3.onCheckedChanged(MSSQLUygulamasiActivity.java:145) 02-11 10:01:28.107: E/AndroidRuntime(1712): at android.widget.CompoundButton.setChecked(CompoundButton.java:126) 02-11 10:01:28.107: E/AndroidRuntime(1712): at android.widget.CompoundButton.toggle(CompoundButton.java:87) 02-11 10:01:28.107: E/AndroidRuntime(1712): at android.widget.CompoundButton.performClick(CompoundButton.java:99) 02-11 10:01:28.107: E/AndroidRuntime(1712): at android.view.View$PerformClick.run(View.java:17355) 02-11 10:01:28.107: E/AndroidRuntime(1712): at android.os.Handler.handleCallback(Handler.java:725) 02-11 10:01:28.107: E/AndroidRuntime(1712): at android.os.Handler.dispatchMessage(Handler.java:92) 02-11 10:01:28.107: E/AndroidRuntime(1712): at android.os.Looper.loop(Looper.java:137) 02-11 10:01:28.107: E/AndroidRuntime(1712): at android.app.ActivityThread.main(ActivityThread.java:5041) 02-11 10:01:28.107: E/AndroidRuntime(1712): at java.lang.reflect.Method.invokeNative(Native Method) 02-11 10:01:28.107: E/AndroidRuntime(1712): at java.lang.reflect.Method.invoke(Method.java:511) 02-11 10:01:28.107: E/AndroidRuntime(1712): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) 02-11 10:01:28.107: E/AndroidRuntime(1712): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) 02-11 10:01:28.107: E/AndroidRuntime(1712): at dalvik.system.NativeStart.main(Native Method) 02-11 10:03:45.875: E/Trace(1805): error opening trace file: No such file or directory (2) 02-11 10:03:51.365: D/dalvikvm(1805): GC_CONCURRENT freed 60K, 7% free 2837K/3020K, paused 6ms+58ms, total 1290ms 02-11 10:03:51.365: D/dalvikvm(1805): WAIT_FOR_CONCURRENT_GC blocked 9ms 02-11 10:03:51.495: D/dalvikvm(1805): GC_FOR_ALLOC freed 21K, 6% free 2955K/3140K, paused 56ms, total 58ms 02-11 10:03:51.524: I/dalvikvm-heap(1805): Grow heap (frag case) to 4.073MB for 1127536-byte allocation 02-11 10:03:51.715: D/dalvikvm(1805): GC_FOR_ALLOC freed <1K, 5% free 4055K/4244K, paused 182ms, total 182ms 02-11 10:03:51.828: D/dalvikvm(1805): GC_CONCURRENT freed <1K, 5% free 4073K/4244K, paused 7ms+19ms, total 118ms 02-11 10:03:53.215: D/dalvikvm(1805): GC_CONCURRENT freed 252K, 8% free 4298K/4668K, paused 88ms+98ms, total 293ms 02-11 10:03:53.764: I/Choreographer(1805): Skipped 35 frames! The application may be doing too much work on its main thread. 02-11 10:03:53.887: D/gralloc_goldfish(1805): Emulator without GPU emulation detected. 02-11 10:04:02.314: I/Choreographer(1805): Skipped 61 frames! The application may be doing too much work on its main thread. 02-11 10:04:06.834: D/dalvikvm(1805): GC_CONCURRENT freed 120K, 7% free 4704K/5036K, paused 87ms+5ms, total 198ms 02-11 10:04:06.834: D/dalvikvm(1805): WAIT_FOR_CONCURRENT_GC blocked 55ms 02-11 10:04:07.654: D/dalvikvm(1805): GC_CONCURRENT freed 137K, 7% free 5228K/5568K, paused 88ms+6ms, total 160ms 02-11 10:04:07.654: D/dalvikvm(1805): WAIT_FOR_CONCURRENT_GC blocked 51ms 02-11 10:04:08.594: D/dalvikvm(1805): GC_CONCURRENT freed 173K, 6% free 5875K/6224K, paused 86ms+6ms, total 164ms 02-11 10:04:09.764: I/Choreographer(1805): Skipped 381 frames! The application may be doing too much work on its main thread. 02-11 10:04:09.824: D/dalvikvm(1805): GC_CONCURRENT freed 190K, 5% free 6756K/7064K, paused 87ms+49ms, total 252ms 02-11 10:04:13.915: D/AndroidRuntime(1805): Shutting down VM 02-11 10:04:13.915: W/dalvikvm(1805): threadid=1: thread exiting with uncaught exception (group=0x40a71930) 02-11 10:04:13.946: E/AndroidRuntime(1805): FATAL EXCEPTION: main 02-11 10:04:13.946: E/AndroidRuntime(1805): java.lang.NullPointerException 02-11 10:04:13.946: E/AndroidRuntime(1805): at com.MSSQL.MSSQLUygulamasiActivity$2.onCheckedChanged(MSSQLUygulamasiActivity.java:130) 02-11 10:04:13.946: E/AndroidRuntime(1805): at android.widget.CompoundButton.setChecked(CompoundButton.java:126) 02-11 10:04:13.946: E/AndroidRuntime(1805): at android.widget.CompoundButton.toggle(CompoundButton.java:87) 02-11 10:04:13.946: E/AndroidRuntime(1805): at android.widget.CompoundButton.performClick(CompoundButton.java:99) 02-11 10:04:13.946: E/AndroidRuntime(1805): at android.view.View$PerformClick.run(View.java:17355) 02-11 10:04:13.946: E/AndroidRuntime(1805): at android.os.Handler.handleCallback(Handler.java:725) 02-11 10:04:13.946: E/AndroidRuntime(1805): at android.os.Handler.dispatchMessage(Handler.java:92) 02-11 10:04:13.946: E/AndroidRuntime(1805): at android.os.Looper.loop(Looper.java:137) 02-11 10:04:13.946: E/AndroidRuntime(1805): at android.app.ActivityThread.main(ActivityThread.java:5041) 02-11 10:04:13.946: E/AndroidRuntime(1805): at java.lang.reflect.Method.invokeNative(Native Method) 02-11 10:04:13.946: E/AndroidRuntime(1805): at java.lang.reflect.Method.invoke(Method.java:511) 02-11 10:04:13.946: E/AndroidRuntime(1805): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) 02-11 10:04:13.946: E/AndroidRuntime(1805): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) 02-11 10:04:13.946: E/AndroidRuntime(1805): at dalvik.system.NativeStart.main(Native Method) 02-11 10:33:25.425: I/Process(1805): Sending signal. PID: 1805 SIG: 9 02-11 10:35:16.914: D/dalvikvm(2060): GC_CONCURRENT freed 52K, 6% free 2779K/2948K, paused 10ms+109ms, total 440ms 02-11 10:35:17.514: D/dalvikvm(2060): GC_FOR_ALLOC freed 21K, 7% free 2956K/3148K, paused 38ms, total 41ms 02-11 10:35:17.534: I/dalvikvm-heap(2060): Grow heap (frag case) to 4.074MB for 1127536-byte allocation 02-11 10:35:17.624: D/dalvikvm(2060): GC_FOR_ALLOC freed <1K, 5% free 4056K/4252K, paused 88ms, total 88ms 02-11 10:35:17.716: D/dalvikvm(2060): GC_CONCURRENT freed <1K, 5% free 4063K/4252K, paused 6ms+27ms, total 98ms 02-11 10:35:18.794: D/dalvikvm(2060): GC_CONCURRENT freed 244K, 8% free 4262K/4624K, paused 46ms+5ms, total 116ms 02-11 10:35:19.574: D/gralloc_goldfish(2060): Emulator without GPU emulation detected. 02-11 10:35:20.967: I/Choreographer(2060): Skipped 41 frames! The application may be doing too much work on its main thread. 02-11 10:35:30.808: D/AndroidRuntime(2060): Shutting down VM 02-11 10:35:30.808: W/dalvikvm(2060): threadid=1: thread exiting with uncaught exception (group=0x40a71930) 02-11 10:35:30.947: E/AndroidRuntime(2060): FATAL EXCEPTION: main 02-11 10:35:30.947: E/AndroidRuntime(2060): java.lang.NullPointerException 02-11 10:35:30.947: E/AndroidRuntime(2060): at com.MSSQL.MSSQLUygulamasiActivity.ad(MSSQLUygulamasiActivity.java:33) 02-11 10:35:30.947: E/AndroidRuntime(2060): at com.MSSQL.MSSQLUygulamasiActivity.access$0(MSSQLUygulamasiActivity.java:32) 02-11 10:35:30.947: E/AndroidRuntime(2060): at com.MSSQL.MSSQLUygulamasiActivity$3.onCheckedChanged(MSSQLUygulamasiActivity.java:146) 02-11 10:35:30.947: E/AndroidRuntime(2060): at android.widget.CompoundButton.setChecked(CompoundButton.java:126) 02-11 10:35:30.947: E/AndroidRuntime(2060): at android.widget.CompoundButton.toggle(CompoundButton.java:87) 02-11 10:35:30.947: E/AndroidRuntime(2060): at android.widget.CompoundButton.performClick(CompoundButton.java:99) 02-11 10:35:30.947: E/AndroidRuntime(2060): at android.view.View$PerformClick.run(View.java:17355) 02-11 10:35:30.947: E/AndroidRuntime(2060): at android.os.Handler.handleCallback(Handler.java:725) 02-11 10:35:30.947: E/AndroidRuntime(2060): at android.os.Handler.dispatchMessage(Handler.java:92) 02-11 10:35:30.947: E/AndroidRuntime(2060): at android.os.Looper.loop(Looper.java:137) 02-11 10:35:30.947: E/AndroidRuntime(2060): at android.app.ActivityThread.main(ActivityThread.java:5041) 02-11 10:35:30.947: E/AndroidRuntime(2060): at java.lang.reflect.Method.invokeNative(Native Method) 02-11 10:35:30.947: E/AndroidRuntime(2060): at java.lang.reflect.Method.invoke(Method.java:511) 02-11 10:35:30.947: E/AndroidRuntime(2060): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) 02-11 10:35:30.947: E/AndroidRuntime(2060): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) 02-11 10:35:30.947: E/AndroidRuntime(2060): at dalvik.system.NativeStart.main(Native Method) 02-11 10:35:39.357: I/Process(2060): Sending signal. PID: 2060 SIG: 9 02-11 10:37:19.605: E/Trace(2140): error opening trace file: No such file or directory (2) 02-11 10:37:21.594: D/dalvikvm(2140): GC_CONCURRENT freed 55K, 7% free 2768K/2952K, paused 10ms+67ms, total 368ms 02-11 10:37:22.387: D/dalvikvm(2140): GC_FOR_ALLOC freed 20K, 5% free 2956K/3112K, paused 109ms, total 111ms 02-11 10:37:22.417: I/dalvikvm-heap(2140): Grow heap (frag case) to 4.074MB for 1127536-byte allocation 02-11 10:37:22.574: D/dalvikvm(2140): GC_FOR_ALLOC freed 1K, 4% free 4056K/4216K, paused 150ms, total 150ms 02-11 10:37:22.774: D/dalvikvm(2140): GC_CONCURRENT freed <1K, 4% free 4064K/4216K, paused 12ms+128ms, total 202ms 02-11 10:37:24.028: D/dalvikvm(2140): GC_CONCURRENT freed 244K, 8% free 4262K/4624K, paused 87ms+6ms, total 174ms 02-11 10:37:24.844: D/gralloc_goldfish(2140): Emulator without GPU emulation detected. 02-11 10:37:26.065: I/Choreographer(2140): Skipped 47 frames! The application may be doing too much work on its main thread. 02-11 10:37:33.915: I/Choreographer(2140): Skipped 96 frames! The application may be doing too much work on its main thread. 02-11 10:37:38.795: D/dalvikvm(2140): GC_CONCURRENT freed 86K, 6% free 4722K/4972K, paused 101ms+5ms, total 197ms 02-11 10:37:39.605: D/dalvikvm(2140): GC_CONCURRENT freed 178K, 6% free 5228K/5544K, paused 101ms+6ms, total 174ms 02-11 10:37:39.605: D/dalvikvm(2140): WAIT_FOR_CONCURRENT_GC blocked 51ms 02-11 10:37:40.405: D/dalvikvm(2140): GC_CONCURRENT freed 174K, 6% free 5875K/6200K, paused 88ms+6ms, total 160ms 02-11 10:37:41.555: D/dalvikvm(2140): GC_CONCURRENT freed 186K, 5% free 6757K/7064K, paused 102ms+91ms, total 267ms 02-11 10:37:41.575: I/Choreographer(2140): Skipped 338 frames! The application may be doing too much work on its main thread. 02-11 10:37:54.434: D/dalvikvm(2140): GC_CONCURRENT freed 320K, 6% free 7796K/8244K, paused 107ms+11ms, total 182ms 02-11 10:37:54.434: D/dalvikvm(2140): WAIT_FOR_CONCURRENT_GC blocked 75ms 02-11 10:37:56.494: I/Choreographer(2140): Skipped 478 frames! The application may be doing too much work on its main thread. 02-11 10:37:56.674: D/dalvikvm(2140): GC_CONCURRENT freed 355K, 5% free 9117K/9596K, paused 98ms+117ms, total 309ms 02-11 10:43:11.764: E/Trace(2278): error opening trace file: No such file or directory (2) 02-11 10:43:13.937: D/dalvikvm(2278): GC_CONCURRENT freed 59K, 6% free 2798K/2976K, paused 6ms+90ms, total 401ms 02-11 10:43:14.639: D/dalvikvm(2278): GC_FOR_ALLOC freed 21K, 6% free 2955K/3136K, paused 233ms, total 240ms 02-11 10:43:14.654: I/dalvikvm-heap(2278): Grow heap (frag case) to 4.074MB for 1127536-byte allocation 02-11 10:43:14.804: D/dalvikvm(2278): GC_FOR_ALLOC freed <1K, 5% free 4056K/4240K, paused 148ms, total 148ms 02-11 10:43:14.974: D/dalvikvm(2278): GC_CONCURRENT freed <1K, 5% free 4059K/4240K, paused 10ms+103ms, total 176ms 02-11 10:43:16.164: D/dalvikvm(2278): GC_CONCURRENT freed 205K, 7% free 4301K/4624K, paused 74ms+20ms, total 174ms 02-11 10:43:16.924: I/Choreographer(2278): Skipped 37 frames! The application may be doing too much work on its main thread. 02-11 10:43:17.084: D/gralloc_goldfish(2278): Emulator without GPU emulation detected. 02-11 10:43:18.124: I/Choreographer(2278): Skipped 37 frames! The application may be doing too much work on its main thread. 02-11 10:43:40.674: D/AndroidRuntime(2278): Shutting down VM 02-11 10:43:40.674: W/dalvikvm(2278): threadid=1: thread exiting with uncaught exception (group=0x40a71930) 02-11 10:43:40.804: E/AndroidRuntime(2278): FATAL EXCEPTION: main 02-11 10:43:40.804: E/AndroidRuntime(2278): java.lang.NullPointerException 02-11 10:43:40.804: E/AndroidRuntime(2278): at com.MSSQL.MSSQLUygulamasiActivity.ad(MSSQLUygulamasiActivity.java:33) 02-11 10:43:40.804: E/AndroidRuntime(2278): at com.MSSQL.MSSQLUygulamasiActivity.access$0(MSSQLUygulamasiActivity.java:32) 02-11 10:43:40.804: E/AndroidRuntime(2278): at com.MSSQL.MSSQLUygulamasiActivity$3.onCheckedChanged(MSSQLUygulamasiActivity.java:146) 02-11 10:43:40.804: E/AndroidRuntime(2278): at android.widget.CompoundButton.setChecked(CompoundButton.java:126) 02-11 10:43:40.804: E/AndroidRuntime(2278): at android.widget.CompoundButton.toggle(CompoundButton.java:87) 02-11 10:43:40.804: E/AndroidRuntime(2278): at android.widget.CompoundButton.performClick(CompoundButton.java:99) 02-11 10:43:40.804: E/AndroidRuntime(2278): at android.view.View$PerformClick.run(View.java:17355) 02-11 10:43:40.804: E/AndroidRuntime(2278): at android.os.Handler.handleCallback(Handler.java:725) 02-11 10:43:40.804: E/AndroidRuntime(2278): at android.os.Handler.dispatchMessage(Handler.java:92) 02-11 10:43:40.804: E/AndroidRuntime(2278): at android.os.Looper.loop(Looper.java:137) 02-11 10:43:40.804: E/AndroidRuntime(2278): at android.app.ActivityThread.main(ActivityThread.java:5041) 02-11 10:43:40.804: E/AndroidRuntime(2278): at java.lang.reflect.Method.invokeNative(Native Method) 02-11 10:43:40.804: E/AndroidRuntime(2278): at java.lang.reflect.Method.invoke(Method.java:511) 02-11 10:43:40.804: E/AndroidRuntime(2278): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) 02-11 10:43:40.804: E/AndroidRuntime(2278): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) 02-11 10:43:40.804: E/AndroidRuntime(2278): at dalvik.system.NativeStart.main(Native Method) 02-11 10:46:03.105: D/dalvikvm(2366): GC_CONCURRENT freed 62K, 7% free 2778K/2956K, paused 7ms+4ms, total 337ms 02-11 10:46:03.866: D/dalvikvm(2366): GC_FOR_ALLOC freed 21K, 6% free 2956K/3136K, paused 286ms, total 293ms 02-11 10:46:03.875: I/dalvikvm-heap(2366): Grow heap (frag case) to 4.074MB for 1127536-byte allocation 02-11 10:46:04.025: D/dalvikvm(2366): GC_FOR_ALLOC freed <1K, 5% free 4056K/4240K, paused 145ms, total 145ms 02-11 10:46:04.125: D/dalvikvm(2366): GC_CONCURRENT freed <1K, 5% free 4064K/4240K, paused 5ms+11ms, total 100ms 02-11 10:46:05.255: D/dalvikvm(2366): GC_CONCURRENT freed 244K, 8% free 4262K/4624K, paused 92ms+5ms, total 173ms 02-11 10:46:06.015: D/gralloc_goldfish(2366): Emulator without GPU emulation detected. 02-11 10:46:07.055: I/Choreographer(2366): Skipped 32 frames! The application may be doing too much work on its main thread. 02-11 10:46:14.494: I/Choreographer(2366): Skipped 64 frames! The application may be doing too much work on its main thread. 02-11 10:46:16.514: I/Choreographer(2366): Skipped 72 frames! The application may be doing too much work on its main thread. 02-11 10:46:16.554: D/dalvikvm(2366): GC_CONCURRENT freed 83K, 6% free 4716K/4972K, paused 140ms+134ms, total 482ms 02-11 10:46:19.058: I/Choreographer(2366): Skipped 41 frames! The application may be doing too much work on its main thread. 02-11 10:46:20.214: I/Choreographer(2366): Skipped 57 frames! The application may be doing too much work on its main thread. 02-11 10:46:20.374: D/dalvikvm(2366): GC_CONCURRENT freed 141K, 6% free 5230K/5524K, paused 87ms+121ms, total 307ms 02-11 10:46:21.444: I/Choreographer(2366): Skipped 62 frames! The application may be doing too much work on its main thread. 02-11 10:46:22.764: I/Choreographer(2366): Skipped 109 frames! The application may be doing too much work on its main thread. 02-11 10:46:23.355: D/dalvikvm(2366): GC_CONCURRENT freed 186K, 5% free 5914K/6224K, paused 101ms+6ms, total 201ms 02-11 10:46:23.914: I/Choreographer(2366): Skipped 106 frames! The application may be doing too much work on its main thread. 02-11 10:59:35.454: E/Trace(2624): error opening trace file: No such file or directory (2) 02-11 10:59:37.514: D/dalvikvm(2624): GC_CONCURRENT freed 65K, 7% free 2774K/2960K, paused 9ms+129ms, total 496ms 02-11 10:59:38.475: D/dalvikvm(2624): GC_FOR_ALLOC freed 20K, 6% free 2956K/3140K, paused 199ms, total 201ms 02-11 10:59:38.495: I/dalvikvm-heap(2624): Grow heap (frag case) to 4.075MB for 1127536-byte allocation 02-11 10:59:38.625: D/dalvikvm(2624): GC_FOR_ALLOC freed 1K, 5% free 4056K/4244K, paused 128ms, total 128ms 02-11 10:59:38.817: D/dalvikvm(2624): GC_CONCURRENT freed 1K, 5% free 4064K/4244K, paused 7ms+104ms, total 197ms 02-11 10:59:40.285: D/dalvikvm(2624): GC_CONCURRENT freed 244K, 8% free 4262K/4624K, paused 108ms+6ms, total 189ms 02-11 10:59:41.015: D/gralloc_goldfish(2624): Emulator without GPU emulation detected. 02-11 10:59:49.635: D/AndroidRuntime(2624): Shutting down VM 02-11 10:59:49.635: W/dalvikvm(2624): threadid=1: thread exiting with uncaught exception (group=0x40a71930) 02-11 10:59:49.695: E/AndroidRuntime(2624): FATAL EXCEPTION: main 02-11 10:59:49.695: E/AndroidRuntime(2624): java.lang.NullPointerException 02-11 10:59:49.695: E/AndroidRuntime(2624): at com.MSSQL.MSSQLUygulamasiActivity.ad(MSSQLUygulamasiActivity.java:33) 02-11 10:59:49.695: E/AndroidRuntime(2624): at com.MSSQL.MSSQLUygulamasiActivity.access$0(MSSQLUygulamasiActivity.java:32) 02-11 10:59:49.695: E/AndroidRuntime(2624): at com.MSSQL.MSSQLUygulamasiActivity$3.onCheckedChanged(MSSQLUygulamasiActivity.java:146) 02-11 10:59:49.695: E/AndroidRuntime(2624): at android.widget.CompoundButton.setChecked(CompoundButton.java:126) 02-11 10:59:49.695: E/AndroidRuntime(2624): at android.widget.CompoundButton.toggle(CompoundButton.java:87) 02-11 10:59:49.695: E/AndroidRuntime(2624): at android.widget.CompoundButton.performClick(CompoundButton.java:99) 02-11 10:59:49.695: E/AndroidRuntime(2624): at android.view.View$PerformClick.run(View.java:17355) 02-11 10:59:49.695: E/AndroidRuntime(2624): at android.os.Handler.handleCallback(Handler.java:725) 02-11 10:59:49.695: E/AndroidRuntime(2624): at android.os.Handler.dispatchMessage(Handler.java:92) 02-11 10:59:49.695: E/AndroidRuntime(2624): at android.os.Looper.loop(Looper.java:137) 02-11 10:59:49.695: E/AndroidRuntime(2624): at android.app.ActivityThread.main(ActivityThread.java:5041) 02-11 10:59:49.695: E/AndroidRuntime(2624): at java.lang.reflect.Method.invokeNative(Native Method) 02-11 10:59:49.695: E/AndroidRuntime(2624): at java.lang.reflect.Method.invoke(Method.java:511) 02-11 10:59:49.695: E/AndroidRuntime(2624): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) 02-11 10:59:49.695: E/AndroidRuntime(2624): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) 02-11 10:59:49.695: E/AndroidRuntime(2624): at dalvik.system.NativeStart.main(Native Method)[/code]
spinner backround color
spinnerın arkaplan rengini bir türlü değiştiremedim yardımcı olur musunuz?
sqlite kullanımı
stok takip için içinde resim alanı ve 3 alan daha bulunan bi listeyi sqlite a kaydedip okutmam gerekiyor.
https://gelecegiyazanlar.turkcell.com.tr/konu/android/egitim/android-401/veritabani-kullanimi
buradaki örneği deneyim fakat uygulama patladı yardımcı olurmusunuz?
gruplama
sql serverdan çektiğim verileri 5 er 5 er sayfalandırmak istiyorum. fakat mantığını kuramadım yardımcı olabilir misiniz.
sqlite kullanımı
01-09 09:31:29.019: E/AndroidRuntime(273): FATAL EXCEPTION: main
01-09 09:31:29.019: E/AndroidRuntime(273): android.content.res.Resources$NotFoundException: Resource ID #0x7f080001 type #0x12 is not valid
01-09 09:31:29.019: E/AndroidRuntime(273): at android.content.res.Resources.loadXmlResourceParser(Resources.java:1874)
01-09 09:31:29.019: E/AndroidRuntime(273): at android.content.res.Resources.getLayout(Resources.java:731)
01-09 09:31:29.019: E/AndroidRuntime(273): at android.view.LayoutInflater.inflate(LayoutInflater.java:318)
01-09 09:31:29.019: E/AndroidRuntime(273): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
01-09 09:31:29.019: E/AndroidRuntime(273): at com.example.test.MyListAdapter.getView(MyListAdapter.java:42)
01-09 09:31:29.019: E/AndroidRuntime(273): at android.widget.AbsListView.obtainView(AbsListView.java:1315)
01-09 09:31:29.019: E/AndroidRuntime(273): at android.widget.ListView.makeAndAddView(ListView.java:1727)
01-09 09:31:29.019: E/AndroidRuntime(273): at android.widget.ListView.fillDown(ListView.java:652)
01-09 09:31:29.019: E/AndroidRuntime(273): at android.widget.ListView.fillFromTop(ListView.java:709)
01-09 09:31:29.019: E/AndroidRuntime(273): at android.widget.ListView.layoutChildren(ListView.java:1580)
01-09 09:31:29.019: E/AndroidRuntime(273): at android.widget.AbsListView.onLayout(AbsListView.java:1147)
01-09 09:31:29.019: E/AndroidRuntime(273): at android.view.View.layout(View.java:7035)
01-09 09:31:29.019: E/AndroidRuntime(273): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1249)
01-09 09:31:29.019: E/AndroidRuntime(273): at android.widget.LinearLayout.layoutHorizontal(LinearLayout.java:1238)
01-09 09:31:29.019: E/AndroidRuntime(273): at android.widget.LinearLayout.onLayout(LinearLayout.java:1044)
01-09 09:31:29.019: E/AndroidRuntime(273): at android.view.View.layout(View.java:7035)
01-09 09:31:29.019: E/AndroidRuntime(273): at android.widget.FrameLayout.onLayout(FrameLayout.java:333)
01-09 09:31:29.019: E/AndroidRuntime(273): at android.view.View.layout(View.java:7035)
01-09 09:31:29.019: E/AndroidRuntime(273): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1249)
01-09 09:31:29.019: E/AndroidRuntime(273): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1125)
01-09 09:31:29.019: E/AndroidRuntime(273): at android.widget.LinearLayout.onLayout(LinearLayout.java:1042)
01-09 09:31:29.019: E/AndroidRuntime(273): at android.view.View.layout(View.java:7035)
01-09 09:31:29.019: E/AndroidRuntime(273): at android.widget.FrameLayout.onLayout(FrameLayout.java:333)
01-09 09:31:29.019: E/AndroidRuntime(273): at android.view.View.layout(View.java:7035)
01-09 09:31:29.019: E/AndroidRuntime(273): at android.view.ViewRoot.performTraversals(ViewRoot.java:1045)
01-09 09:31:29.019: E/AndroidRuntime(273): at android.view.ViewRoot.handleMessage(ViewRoot.java:1727)
01-09 09:31:29.019: E/AndroidRuntime(273): at android.os.Handler.dispatchMessage(Handler.java:99)
01-09 09:31:29.019: E/AndroidRuntime(273): at android.os.Looper.loop(Looper.java:123)
01-09 09:31:29.019: E/AndroidRuntime(273): at android.app.ActivityThread.main(ActivityThread.java:4627)
01-09 09:31:29.019: E/AndroidRuntime(273): at java.lang.reflect.Method.invokeNative(Native Method)
01-09 09:31:29.019: E/AndroidRuntime(273): at java.lang.reflect.Method.invoke(Method.java:521)
01-09 09:31:29.019: E/AndroidRuntime(273): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
01-09 09:31:29.019: E/AndroidRuntime(273): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
01-09 09:31:29.019: E/AndroidRuntime(273): at dalvik.system.NativeStart.main(Native Method)
01-09 09:36:29.559: I/Process(273): Sending signal. PID: 273 SIG: 9
sqlite kullanımı
Country.java
[code]
package com.example.test;
import java.io.Serializable;
public class Country implements Serializable {
private static final long serialVersionUID = 1L;
private int id;
private String countryName;
private String countryCode;
public Country() {
super();
}
public Country(String countryName, String countryCode) {
super();
this.countryName = countryName;
this.countryCode = countryCode;
}
public String getCountryCode() {
return countryCode;
}
public void setCountryCode(String countryCode) {
this.countryCode = countryCode;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getCountryName() {
return countryName;
}
public void setCountryName(String countryName) {
this.countryName = countryName;
}
}
[/code]
DBHelper.java
[code]
package com.example.test;
import java.util.ArrayList;
import java.util.List;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;
public class DBHelper extends SQLiteOpenHelper {
private static final String DATABASE_NAME = "turkcellDB";
// Contacts table name
private static final String TABLE_COUNTRIES = "countries";
public DBHelper(Context context) {
super(context, DATABASE_NAME, null, 1);
}
public List<Country> getAllCountries() {
List<Country> countries = new ArrayList<Country>();
SQLiteDatabase db = this.getWritableDatabase();
// String sqlQuery = "SELECT * FROM " + TABLE_COUNTRIES;
// Cursor cursor = db.rawQuery(sqlQuery, null);
Cursor cursor = db.query(TABLE_COUNTRIES, new String[]{"id", "country_name", "country_code"}, null, null, null, null, null);
while (cursor.moveToNext()) {
Country country = new Country();
country.setId(cursor.getInt(0));
country.setCountryName(cursor.getString(1));
country.setCountryCode(cursor.getString(2));
countries.add(country);
}
return countries;
}
public void insertCountry(Country country) {
SQLiteDatabase db = this.getWritableDatabase();
ContentValues values = new ContentValues();
values.put("country_name", country.getCountryName());
values.put("country_code", country.getCountryCode());
db.insert(TABLE_COUNTRIES, null, values);
db.close();
}
@Override
public void onCreate(SQLiteDatabase db) {
String sql = "CREATE TABLE " + TABLE_COUNTRIES + "(id INTEGER PRIMARY KEY,country_name TEXT,country_code TEXT" + ")";
Log.d("DBHelper", "SQL : " + sql);
db.execSQL(sql);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
db.execSQL("DROP TABLE IF EXISTS " + TABLE_COUNTRIES);
onCreate(db);
}
}
[/code]
MainActivity.java
[code]
package com.example.test;
import java.util.List;
import android.os.Bundle;
import android.app.Activity;
import android.content.SharedPreferences;
import android.widget.ListView;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final ListView customListView = (ListView) findViewById(R.id.listview);
DBHelper dbHelper = new DBHelper(getApplicationContext());
SharedPreferences settings = getSharedPreferences("SQL", 0);
boolean firstTime = settings.getBoolean("firstTime", true);
if (firstTime) {
dbHelper.insertCountry(new Country("Turkiye", "90"));
dbHelper.insertCountry(new Country("Amerika", "1"));
dbHelper.insertCountry(new Country("Ingiltere", "44"));
dbHelper.insertCountry(new Country("Almanya", "49"));
SharedPreferences.Editor editor = settings.edit();
editor.putBoolean("firstTime", false);
editor.commit();
}
List<Country> countries = dbHelper.getAllCountries();
MyListAdapter myListAdapter = new MyListAdapter(MainActivity.this, countries);
customListView.setAdapter(myListAdapter);
}
}
[/code]
MyListAdapter.java
[code]
package com.example.test;
import java.util.List;
import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
public class MyListAdapter extends BaseAdapter {
private LayoutInflater inflater;
private List<Country> countryList;
public MyListAdapter(Activity activity, List<Country> countries) {
inflater = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
countryList = countries;
}
@Override
public int getCount() {
return countryList.size();
}
@Override
public Object getItem(int position) {
return countryList.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View vi = convertView;
if (convertView == null)
vi = inflater.inflate(com.example.test.R.id.listview, null); // create layout from
TextView textView = (TextView) vi.findViewById(R.id.row_textview); // user name
Country country = countryList.get(position);
textView.setText(country.getCountryName());
return vi;
}
}
[/code]
activity_main.xml
[code]
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin" >
<TextView
android:id="@+id/row_textview"
android:layout_width="fill_parent"
android:layout_height="30dp"
android:layout_gravity="center" />
<ListView
android:id="@+id/listview"
android:layout_width="fill_parent"
android:layout_height="30dp"
android:layout_gravity="center" />
</LinearLayout>
[/code]
aldığım hata ise
Sorry!
The application test(process com.
example.test) has stopped
unexpectedly. Please try again.
Force close
gruplama
executequery ile mssql den sorgulama yapıyorum while ile satır saatır çekip yazıyorum
5 satır çektikten sonra 2. sayfaya yazdırmak istiyorum.
android kullanıyorum.