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"
Code:
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