Hi,
I am really confused and can't figure out where I am going wrong.
I am trying to use DSFloatingActionButton in my app. My app is already using DSNavigationDrawer and is working fine. That means all the required setups to run DesignSupport components is done properly.
The sample application provided by Corwin ie FloatingActionButton1_0.zip is also working fine and I am able to compile and install on my device.
In one of my activities, if I place a DSFloatingActionButton, then I get the run time error at Activity.LoadLayout itself. The error looks like a resource not found error, but I can't understand what resource is missing. If I remove the DSFab from the Layout then everything works fine.
In the sample provided by Corwin oe FloatingActionButton1_0.zip, I could see a resource folder in his project folder. I understand that the resource is used to display a heart sign inside the DSFab. In my case I am not using any resource on the DSFab. Anyways, I tried copying this folder inside my project too, unfortunately, even then I am getting the same error message.
Can anyone guide me where I am going wrong ?.
Please note that this fails at the line Activity.LoadLayout itself. Please note that the layout contains only an AcToolBarLight and the DSFab.
Here is the error message that I get.
** Activity (myactivity) Create, isFirst = true **
myactivity_activity_create (java line: 360)
java.lang.RuntimeException: android.content.res.Resources$NotFoundException: Resource ID #0x0
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:166)
at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:209)
at com.mycompany.myappname.myactivity._activity_create(myactivity.java:360)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:179)
at com.mycompany.myappname.myactivity.afterFirstLayout(myactivity.java:102)
at com.mycompany.myappname.myactivity.access$000(myactivity.java:17)
at com.mycompany.myappname.myactivity$WaitForLayout.run(myactivity.java:80)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7229)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x0
at android.content.res.Resources.getValue(Resources.java:2558)
at android.content.res.Resources.getDrawable(Resources.java:2001)
at android.content.res.Resources.getDrawable(Resources.java:1987)
at android.content.res.Resources.getDrawable(Resources.java:1961)
at de.amberhome.objects.FloatingActionButtonWrapper.DesignerCreateView(FloatingActionButtonWrapper.java:100)
at anywheresoftware.b4a.objects.CustomViewWrapper.AfterDesignerScript(CustomViewWrapper.java:70)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:158)
... 14 more
** Service (newinst2) Start **
-- AppUpdating.NewInst2: processing service_start
Here is the code
Here is the Layout
Regards
Anser
I am really confused and can't figure out where I am going wrong.
I am trying to use DSFloatingActionButton in my app. My app is already using DSNavigationDrawer and is working fine. That means all the required setups to run DesignSupport components is done properly.
The sample application provided by Corwin ie FloatingActionButton1_0.zip is also working fine and I am able to compile and install on my device.
In one of my activities, if I place a DSFloatingActionButton, then I get the run time error at Activity.LoadLayout itself. The error looks like a resource not found error, but I can't understand what resource is missing. If I remove the DSFab from the Layout then everything works fine.
In the sample provided by Corwin oe FloatingActionButton1_0.zip, I could see a resource folder in his project folder. I understand that the resource is used to display a heart sign inside the DSFab. In my case I am not using any resource on the DSFab. Anyways, I tried copying this folder inside my project too, unfortunately, even then I am getting the same error message.
Can anyone guide me where I am going wrong ?.
Please note that this fails at the line Activity.LoadLayout itself. Please note that the layout contains only an AcToolBarLight and the DSFab.
Here is the error message that I get.
** Activity (myactivity) Create, isFirst = true **
myactivity_activity_create (java line: 360)
java.lang.RuntimeException: android.content.res.Resources$NotFoundException: Resource ID #0x0
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:166)
at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:209)
at com.mycompany.myappname.myactivity._activity_create(myactivity.java:360)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:179)
at com.mycompany.myappname.myactivity.afterFirstLayout(myactivity.java:102)
at com.mycompany.myappname.myactivity.access$000(myactivity.java:17)
at com.mycompany.myappname.myactivity$WaitForLayout.run(myactivity.java:80)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7229)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x0
at android.content.res.Resources.getValue(Resources.java:2558)
at android.content.res.Resources.getDrawable(Resources.java:2001)
at android.content.res.Resources.getDrawable(Resources.java:1987)
at android.content.res.Resources.getDrawable(Resources.java:1961)
at de.amberhome.objects.FloatingActionButtonWrapper.DesignerCreateView(FloatingActionButtonWrapper.java:100)
at anywheresoftware.b4a.objects.CustomViewWrapper.AfterDesignerScript(CustomViewWrapper.java:70)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:158)
... 14 more
** Service (newinst2) Start **
-- AppUpdating.NewInst2: processing service_start
Here is the code
B4X:
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
#Extends: android.support.v7.app.AppCompatActivity
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Private ActionBar As ACToolBarLight
Private DSFab As DSFloatingActionButton
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Fails at this point itself
Activity.LoadLayout("MyLayoutFile")
Dim ABHelper As ACActionBar
ABHelper.Initialize
ABHelper.ShowUpIndicator = True
ActionBar.InitMenuListener
ActionBar.SubTitle = Starter.CompanyName
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Here is the Layout
Regards
Anser