hi
i got error in first use of data grid in android .
this is my code
public class TestData extends ArrayList<TestDataItem> { Random r = new Random(); public TestData() { Populate(); } public void Populate() { Random r = new Random(); double curr = 10.0; for (int i = 0; i < 1000; i++) { TestDataItem item = new TestDataItem(); item.setLabel(((Integer) i).toString()); curr += -2.0 + r.nextDouble() * 4.0; item.setValue((int) Math.round(curr)); add(item); } }}
public class TestDataItem { private int _value; public int getValue() { return _value; } public int setValue(int value) { _value = value; return value; } private String _label; public String getLabel() { return _label; } public String setLabel(String value) { _label = value; return value; }}
DataGridView dataGrid = new DataGridView(this);TestData data = new TestData();dataGrid.setDataSource(data);RelativeLayout layout = (RelativeLayout)findViewById(R.id.RelLayout1);layout.addView(dataGrid);and this is the error:/AndroidRuntime: FATAL EXCEPTION: main Process: smartview.oceanwide.com.androidsmartview, PID: 21714 java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference at android.icu.text.DecimalFormat.appendAffix(DecimalFormat.java:4317) at android.icu.text.DecimalFormat.subformat(DecimalFormat.java:1395) at android.icu.text.DecimalFormat.subformat(DecimalFormat.java:1331) at android.icu.text.DecimalFormat.format(DecimalFormat.java:928) at android.icu.text.DecimalFormat.format(DecimalFormat.java:784) at java.text.DecimalFormat.format(DecimalFormat.java:617) at java.text.NumberFormat.format(NumberFormat.java:289) at com.infragistics.controls.NumericCellPresenter.formatCellValue(NumericCellPresenter.java:53) at com.infragistics.controls.NumericCellPresenter.modelUpdatedOverride(NumericCellPresenter.java:26) at com.infragistics.controls.CellPresenterBase.modelUpdated(CellPresenterBase.java:13) at com.infragistics.controls.GridContentLayout.doRefresh(GridContentLayout.java:253) at com.infragistics.controls.GridContentLayout.scheduleRefresh(GridContentLayout.java:65) at com.infragistics.controls.GridContentLayout.refresh(GridContentLayout.java:27) at com.infragistics.controls.GridImplementation.refreshPosition(GridImplementation.java:1493) at com.infragistics.controls.GridImplementation.setViewport(GridImplementation.java:1734) at com.infragistics.controls.DataGridView.onSizeChanged(DataGridView.java:196) at android.view.View.sizeChange(View.java:19719) at android.view.View.setFrame(View.java:19680) at android.view.View.layout(View.java:19583) at android.view.ViewGroup.layout(ViewGroup.java:6053) at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1080) at android.view.View.layout(View.java:19586) at android.view.ViewGroup.layout(ViewGroup.java:6053) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323) at android.widget.FrameLayout.onLayout(FrameLayout.java:261) at android.view.View.layout(View.java:19586) at android.view.ViewGroup.layout(ViewGroup.java:6053) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1791) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1635) at android.widget.LinearLayout.onLayout(LinearLayout.java:1544) at android.view.View.layout(View.java:19586) at android.view.ViewGroup.layout(ViewGroup.java:6053) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323) at android.widget.FrameLayout.onLayout(FrameLayout.java:261) at com.android.internal.policy.DecorView.onLayout(DecorView.java:758) at android.view.View.layout(View.java:19586) at android.view.ViewGroup.layout(ViewGroup.java:6053) at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2484) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2200) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1386) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6733) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:911) at android.view.Choreographer.doCallbacks(Choreographer.java:723) at android.view.Choreographer.doFrame(Choreographer.java:658) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897) at android.os.Handler.handleCallback(Handler.java:789) at android.os.Handler.dispatchMessage(Handler.java:98) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6541) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
Hello Azi,
I have been investigating into this behavior you are referring to, and I cannot seem to reproduce this exception you are seeing against the latest (and final) release of the Infragistics for Android .jars.
I would recommend that you ensure that you are using the latest version of the Infragistics for Android .jar files by visiting your account on the Infragistics website at https://www.infragistics.com/my-account/keys-and-downloads and clicking on the 2016.1 product that you are registered to. This will open a new set of tabs, where one reads “Service Releases” and there will be an Android service release for the 16.1.20161.2025 .jar files.
I had mentioned the “(and final)” bit above, because our Android-specific product has been retired and is no longer receiving development. As such, and if at all possible, I would highly recommend moving to usage of our Xamarin.Forms product for mobile development using Infragistics. This product also includes a much-improved data grid control. You can read further about the latest Infragistics for Xamarin.Forms release using our documentation: https://www.infragistics.com/help/xamarin/.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewSoftware Developer
hello,
i hope you are doing well.
you mean if we use your datachart and datagrid in our pure android project if there was a problem you can't support us?
if there was a bug in your library you can't reolve it?
thanks
i tried on emulator, happened the same and on a galaxy s6 the same exception. i believe something with my code or jar file . how can i send you my application ? it's 38 kb. or how you can send me your jar files?
If your sample project is only 38kb, you should be able to attach it to this forum thread after compressing it to a .zip file format.
Regarding sending you the jars, I cannot do this as we do not make our assemblies or jar files publically available through our forums, but I am using the same jars as the ones you can download from the website by clicking the "Download Trial" button, here: https://www.infragistics.com/products/android. From what I understand of the above, these are the same ones you are using.
Regarding testing, I have tested on a few different devices - one including a Nexus 5.x simulation. The other devices I have tested against are an HTC One running Android 4.4.2 and a Google Pixel running 8.0.0. On each of these devices, the sample code that you have provided in the original description of this support case works normally.
I am also attaching my sample project for reference. You should only need to plug-in the jar files that you are using and run.
DataGridTest.zip
i can't build your test project !
Error:Android Source Generator: Error: Can't find bundle for base name messages.AndroidJpsBundle, locale en_CAjava.util.MissingResourceException: Can't find bundle for base name messages.AndroidJpsBundle, locale en_CA at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1564) at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1387) at java.util.ResourceBundle.getBundle(ResourceBundle.java:773) at org.jetbrains.jps.android.AndroidJpsBundle.getBundle(AndroidJpsBundle.java:22) at org.jetbrains.jps.android.AndroidJpsBundle.message(AndroidJpsBundle.java:32) at org.jetbrains.jps.android.AndroidSourceGeneratingBuilder.runAaptCompiler(AndroidSourceGeneratingBuilder.java:971) at org.jetbrains.jps.android.AndroidSourceGeneratingBuilder.doBuild(AndroidSourceGeneratingBuilder.java:210) at org.jetbrains.jps.android.AndroidSourceGeneratingBuilder.build(AndroidSourceGeneratingBuilder.java:114) at org.jetbrains.jps.incremental.IncProjectBuilder.runModuleLevelBuilders(IncProjectBuilder.java:1263) at org.jetbrains.jps.incremental.IncProjectBuilder.runBuildersForChunk(IncProjectBuilder.java:940) at org.jetbrains.jps.incremental.IncProjectBuilder.buildTargetsChunk(IncProjectBuilder.java:1012) at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunkIfAffected(IncProjectBuilder.java:903) at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunks(IncProjectBuilder.java:736) at org.jetbrains.jps.incremental.IncProjectBuilder.runBuild(IncProjectBuilder.java:384) at org.jetbrains.jps.incremental.IncProjectBuilder.build(IncProjectBuilder.java:192) at org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:138) at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:295) at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:125) at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler.lambda$channelRead0$0(BuildMain.java:236) at org.jetbrains.jps.service.impl.SharedThreadPoolImpl.lambda$executeOnPooledThread$0(SharedThreadPoolImpl.java:42) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)
It appears that this issue is due to a missing resources bundle. As I am currently on a localized en-US culture, this will not create a bundle for the en_CA culture that your machine is likely using. I am personally unsure of how to get the Android project to "regenerate" its localized bundles, but it appears others are having the same issue in this case, and so perhaps the following forum thread will help you on this matter: https://stackoverflow.com/questions/12986234/cant-find-bundle-for-base-name-bundle-locale-en-us.
i couldn't build your project here is my project .would you please take a look.
infragrid.rar