B4A Library MSMaterialDialogs

Anser

Well-Known Member
Licensed User
Longtime User
The sample is working fine on my phone. When I tried to include MsMaterialDialogs in my existing project that already use AppCompat and MsMaterialDrawer, my app quit abnormaly.

It throws the error message "Unfortunately, 'MyAppName' has stopped"

B4X:
Sub AskHMR_Reading(cHmrReading As String)
    Dim dumy As EditText
    Msgbox(cHmrReading,"HMR Reading")
   
    Dim builder As MSDialogBuilder
    builder.Initialize("MyDialog")
    builder.setTitle("Change HMR Reading").setMessage("Please type the HMR Reading").setThemeColor(Colors.Yellow)
    builder.setButton(DialogResponse.POSITIVE , "OK")
    builder.setCancelable(True)
    ' I tried DESIGN_MATERIAL_LIGHT, DESIGN_HOLO_DARK etc
    builder.setDesign(builder.DESIGN_MATERIAL_DARK)
    builder.setEditTextStyle(cHmrReading, "HMR Reading",Colors.Black,Colors.Gray,dumy.INPUT_TYPE_NUMBERS)
    builder.showKeyboardOnDisplay(True)

    ' Till here it works fine. The next line makes my app quit abnormally
    builder.show   
End Sub

Sub MyDialog_DialogResponse(Buttonclicked As Int) As Boolean
    Log(Buttonclicked)
    Return True
End Sub

'Return path for EditText dialogs
Sub MyDialog_TextAccepted(SelectedText As String)
    Log(SelectedText)
    Msgbox(SelectedText,"SelectedText")
End Sub

The following line
builder.setDesign(builder.DESIGN_MATERIAL_LIGHT) throws the error message "Unfortunately, 'MyAppName' has stopped"
builder.setDesign(builder.DESIGN_MATERIAL_DARK) throws the error message "Unfortunately, 'MyAppName' has stopped"

when I change that line to
builder.setDesign(builder.DESIGN_HOLO_DARK) or if I comment out this line then
I get error at the following line
builder.setEditTextStyle(cHmrReading, "HMR Reading",Colors.Black,Colors.Gray,dumy.INPUT_TYPE_NUMBERS)

The error message is
An error has occured in sub:calldetails_askhmr_reading (java line: 432)
java.lang.ClassCastException:
android.graphics.drawable.InsetDrawable cannot be cast to android.graphics.drawable.StateListDrawable


As I mentioned above, the sample app that was bundled along with the lib is compiling and running perfect on my phone. I assume that the problem may be this lib is not compatible with AppCompat, MsMAterialDrawer ? Just a wild guess.

Any help will be appreciated.

Regards

Anser
 

zani

Member
Licensed User
Longtime User
e:\b4asource\test\res1\layout\layout_holo_dialog.xml:2: error: No resource identifier found for attribute 'layout_marginStart' in package 'android'
e:\b4asource\test\res1\layout\layout_holo_dialog.xml:2: error: No resource identifier found for attribute 'layout_marginEnd' in package 'android'
hi i have this error
 

chrjak

Active Member
Licensed User
Longtime User
Crashes since upgrading targetsdk to 28

android.view.InflateException: Binary XML file line #2: Binary XML file line #2: Error inflating class com.andexert.library.RippleView
Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x7f040004

rFile:
public static final int TextAppearance_Compat_Notification_Title_Media=0x7f040004;

I can't get behind it - also tried editing the only android:src of the xml res to app:srcCompat
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…