java - how to set on click method for text inside dialog -
I have a dialog in which TextView has a number inside the textView, so I want to set the onClick method for TextView I want to use the call method to call numbers inside TextView
Inside the dialog xml file I set the textview below. + ID / Image "Android: onClick =" no1 "android: clickable =" true "/>
And this is my dialogue
last dialog dialog = new dialog (reference); Dialog.setContentView (R.layout.pop); // Pop My Dialog is the xml dialog. Sitetle ("phone call"); Textview text = (textview) dialogue.fidvibid (rdtext1); Text.setText (value [0]); /// I am calling number from ARAR Public Wide Number 1 (see V) {intial dial = new intent (); Dial.setAction ("android.intent.action.DIAL"); Dial.setData (Uri.parse ("Telephone:" + values [0])); StartActivity (dial); }
But the onClick method (no1) is incorrect, it says, "There is an invalid type for zero zero variables"
How do I work in. Can I correct the dialogue? I tried to put it outside the dialog but when I click on text visit, the logcat says
11-04 13: 39: 48.666: E / Android Random (2624 9): Java.lang.IllegalStateException: See no method for activity class and android (see). Visual class for view.ContextThemeWrapper onClick handler and the id 'text1'
at android.widget.TextView then it looks like the function is not available
last dialog dialog = new dialog (reference); Dialog.setContentView (R.layout.pop); // Pop My Dialog is the xml dialog. Sitetle ("phone call"); Textview text = (textview) dialogue.fidvibid (rdtext1); Text.setText (value [0]); Text.setOnClickListener (see the new OnClickListener) {click on Public Zero (see view) {intial dial = new intent (;); dial .set action ("android.intent.action.DIAL"); Dial .Setadata (Uri . "Tale:" + Global.values [0])); Initial activity (dial);}});
Comments
Post a Comment