سلام چطور میشه از کتابخانه aria glide تصویر مستقیم وارد MC7RoundedImageView کرد من این کار رو کردم خطای می دهد.
#Region Project Attributes
#ApplicationLabel: B4A Example
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
End Sub
Sub Globals
Dim MC7RoundedImageView10 As MC7RoundedImageView
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("1")
MC7RoundedImageView10.Initialize("MC7RoundedImageView10")
MC7RoundedImageView10.BorderColors = Colors.White
MC7RoundedImageView10.BorderWidth = 3dip
MC7RoundedImageView10.CornerRadius = 255
MC7RoundedImageView10.MutateBackground = True
Activity.AddView(MC7RoundedImageView10 , 60%x , 60%x ,100dip , 100dip)
Dim AriaGlide As AriaGlide
AriaGlide.Load("https://s.cafebazaar.ir/1/icons/akhbar.esteghlal.tehran_512x512.png").AsBitmap.IntoTarget("Glide",MC7RoundedImageView10)
End Sub
Sub Glide_OnBitmapReady(bitmap As Bitmap,Tag As Object)
Dim mc7img As MC7RoundedImageView=Tag
If mc7img.IsInitialized=True Then
mc7img.ImageBitmap=bitmap
End If
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
خطا:
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
main_glide_onbitmapready (java line: 382)
java.lang.NullPointerException: Attempt to invoke virtual method 'void com.makeramen.roundedimageview.RoundedImageView.setImageBitmap(android.graphics.Bitmap)' on a null object reference
at com.roundedimageview.mc7.MC7RoundedImageView.setImageBitmap(MC7RoundedImageView.java:220)
at b4a.example.main._glide_onbitmapready(main.java:382)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:191)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:171)
at ariagp.amin.shahedi.BitmapRequestWrapper$1.onResourceReady(BitmapRequestWrapper.java:89)
at ariagp.amin.shahedi.BitmapRequestWrapper$1.onResourceReady(BitmapRequestWrapper.java:83)
at com.bumptech.glide.request.GenericRequest.onResourceReady(GenericRequest.java:525)
at com.bumptech.glide.request.GenericRequest.onResourceReady(GenericRequest.java:507)
at com.bumptech.glide.load.engine.EngineJob.handleResultOnMainThread(EngineJob.java:158)
at com.bumptech.glide.load.engine.EngineJob.access$100(EngineJob.java:22)
at com.bumptech.glide.load.engine.EngineJob$MainThreadCallback.handleMessage(EngineJob.java:202)
at android.os.Handler.dispatchMessage(Handler.java:101)
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)
سوال
hosseinkarimian 100
سلام چطور میشه از کتابخانه aria glide تصویر مستقیم وارد MC7RoundedImageView کرد من این کار رو کردم خطای می دهد.
#Region Project Attributes #ApplicationLabel: B4A Example #VersionCode: 1 #VersionName: 'SupportedOrientations possible values: unspecified, landscape or portrait. #SupportedOrientations: unspecified #CanInstallToExternalStorage: False #End Region #Region Activity Attributes #FullScreen: False #IncludeTitle: True #End Region Sub Process_Globals End Sub Sub Globals Dim MC7RoundedImageView10 As MC7RoundedImageView End Sub Sub Activity_Create(FirstTime As Boolean) 'Do not forget to load the layout file created with the visual designer. For example: Activity.LoadLayout("1") MC7RoundedImageView10.Initialize("MC7RoundedImageView10") MC7RoundedImageView10.BorderColors = Colors.White MC7RoundedImageView10.BorderWidth = 3dip MC7RoundedImageView10.CornerRadius = 255 MC7RoundedImageView10.MutateBackground = True Activity.AddView(MC7RoundedImageView10 , 60%x , 60%x ,100dip , 100dip) Dim AriaGlide As AriaGlide AriaGlide.Load("https://s.cafebazaar.ir/1/icons/akhbar.esteghlal.tehran_512x512.png").AsBitmap.IntoTarget("Glide",MC7RoundedImageView10) End Sub Sub Glide_OnBitmapReady(bitmap As Bitmap,Tag As Object) Dim mc7img As MC7RoundedImageView=Tag If mc7img.IsInitialized=True Then mc7img.ImageBitmap=bitmap End If End Sub Sub Activity_Resume End Sub Sub Activity_Pause (UserClosed As Boolean) End Sub
خطا:
*** Service (starter) Create *** ** Service (starter) Start ** ** Activity (main) Create, isFirst = true ** ** Activity (main) Resume ** main_glide_onbitmapready (java line: 382) java.lang.NullPointerException: Attempt to invoke virtual method 'void com.makeramen.roundedimageview.RoundedImageView.setImageBitmap(android.graphics.Bitmap)' on a null object reference at com.roundedimageview.mc7.MC7RoundedImageView.setImageBitmap(MC7RoundedImageView.java:220) at b4a.example.main._glide_onbitmapready(main.java:382) at java.lang.reflect.Method.invoke(Native Method) at anywheresoftware.b4a.BA.raiseEvent2(BA.java:191) at anywheresoftware.b4a.BA.raiseEvent(BA.java:171) at ariagp.amin.shahedi.BitmapRequestWrapper$1.onResourceReady(BitmapRequestWrapper.java:89) at ariagp.amin.shahedi.BitmapRequestWrapper$1.onResourceReady(BitmapRequestWrapper.java:83) at com.bumptech.glide.request.GenericRequest.onResourceReady(GenericRequest.java:525) at com.bumptech.glide.request.GenericRequest.onResourceReady(GenericRequest.java:507) at com.bumptech.glide.load.engine.EngineJob.handleResultOnMainThread(EngineJob.java:158) at com.bumptech.glide.load.engine.EngineJob.access$100(EngineJob.java:22) at com.bumptech.glide.load.engine.EngineJob$MainThreadCallback.handleMessage(EngineJob.java:202) at android.os.Handler.dispatchMessage(Handler.java:101) 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)
لینک ارسال
به اشتراک گذاری در سایت های دیگر
3 پاسخ به این سوال تاکنون داده شده است
ارسالهای توصیه شده
بایگانی شده
این موضوع بایگانی و قفل شده و دیگر امکان ارسال پاسخ نیست.