Saturday, 15 February 2014

android - How to use setCompoundDrawables with Xamarin c# -


So I'm struggling with a specific line of code for a long time. Here it is:

  BTnForWord Set Compand Drabs With Internents Bound (0,0, Android. Resource Drawable. ICMediaplay, 0);  

Whenever this line is called My App Crash and my app output states the following:

[Mono-RT] java.lang.NoSuchMethodError : There is no way to name = 'gainable' signature = '(i) landroid / graphics / drobble / dry;' Landroide / content / class in class;
[Mono-RT] at com.enterprise.project.CallDetails.n_onCreate (Basic Method)
[Mono-RT] at com.enterprise.project.CallDetails.onCreate (call details .java: 29)
[Android.app.Activity.performCreate at (Mono-RT)] (Activity.JavaTT 104)
[Mono-RT] Android.app.introduction.qualityactivityonecrit (instrumentation.java 108080)) [Android ] Mono-RT] ActiveTrade.Perform Launching Activity (ActivityTrad.Java News 144)
[Mono-RT] Android App Activitathedhardle Launch Activity (Activity Thread: Java 2230)
[Mono-RT] Android. App ActiveTrade.X $ 600 (ActivityTrad.JYRIIT)
[Mono-RT] Android. App ActiveTrade $ H Hondal Message (Activity Thread: Java 1234)
[Mono-RT] Android. OS Handler Dispatch Message (Handler. Java: 99)
[Mono-RT] Android.OS Lopper. Lop (Luor.Java v. 37)
[Mono-RT] At android.app.ActivityThread.main (ActivityThread.java:5041)
[Mono-RT] on java.lang.reflect.Method Joke.lang.reflect.Method.invoke (method.java-- 11)
[Mono-RT] com.android.internal.os.ZygoteInit $ MethodAndArgsCaller on invokeNative (Basic method)
[Mono-RT] .ros (zygotinit.java: 793)
[mono-rt] com.android.internal.os.zygoteInit.main (zygotin.java image 60)
[mono-rt] on dalkvik.system.NativeStart .main (Basic method)

I tried several forms of SetCompoundDrawables (internal, relative, etc ...), but since many other threads said that WithIntrinsicBounds the way I go By the way.

I have tried to use the second version of SetCompoundDrawablesWithIntrinsicBounds (instead of 0, blank instead of 0 and one drawable instead of an ID) but only one problem.

In the case of this problem can be, here are some lines of code used in the block before the bug

  case callstate Paused: // started but stopped for BTNford. Text = "full"; BtnForward.Clickable = true; Btnforward Visibility = ViewStates. Visual; BTN Ford. Setbackgram Color (Android.Graphics.Collar.RGB (30, 118, 121)); BtnForward.SetCompoundDrawablesWithIntrinsicBounds (0,0, Android.Resource.Drawable.IcMediaPlay, 0); break;  

Try your internal activity:

Resource first Retrieve ID:

  _flagResourceId = this.Resources.GetIdentifier ("IcMediaPlay", "Drawable", this.PackageName);  

Then set the diable:

  btnForward.SetCompoundDrawablesWithIntrinsicBounds (0,0, Resource. GetDrawable (_flagResourceId), 0); Resources. Gate Drawable (_flagResourceId)  

No comments:

Post a Comment