Click here to Skip to main content
15,851,711 members
Home / Discussions / Android
   

Android

 
GeneralRe: FCM notification Pin
Malashree Halade9-Sep-17 6:41
Malashree Halade9-Sep-17 6:41 
QuestionRe: FCM notification Pin
David Crow9-Sep-17 15:31
David Crow9-Sep-17 15:31 
Generalfor googple map serach location Pin
Member 133938216-Sep-17 3:23
Member 133938216-Sep-17 3:23 
QuestionRe: for googple map serach location Pin
David Crow6-Sep-17 4:14
David Crow6-Sep-17 4:14 
QuestionRe: for googple map serach location Pin
Richard MacCutchan6-Sep-17 4:55
mveRichard MacCutchan6-Sep-17 4:55 
QuestionRe: for googple map serach location Pin
thatraja6-Sep-17 5:33
professionalthatraja6-Sep-17 5:33 
QuestionIssue navigating to a Fragment Pin
Vimalsoft(Pty) Ltd3-Sep-17 11:56
professionalVimalsoft(Pty) Ltd3-Sep-17 11:56 
Question(View) in a parent or ancestor Context for android:onClick attribute defined on view class Button Pin
Vimalsoft(Pty) Ltd30-Aug-17 8:22
professionalVimalsoft(Pty) Ltd30-Aug-17 8:22 
Good Day Everyone

I have an activity class defined like this
C#
[Activity(Label = "Activity_Home", MainLauncher = false, Icon = "@drawable/lenderlogo", Theme = "@style/MyTheme")]
    public class Activity_Home : ActionBarActivity //AppCompatActivity
    {


and the activity is hosting a Tab that display its content from a fragment. A fragment is defined separately and it has a button that is defined like this

 <Button
android:textSize="10sp"
android:textColor="#FFF"
android:id="@+id/btn_details_save"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="btn_details_saveClick"
android:text="Continue" />

as you can see i have a click event that is triggered when the button is clicked. The code to handle the event of the button is defined in the fragment class file like this
//Find Controls to hook 
                Button btn_details_save = FindViewById<Button>(Resource.Id.btn_details_save);

                // set onclick listener here, by deleting some process
                btn_details_save.Click += delegate
                {
                    btn_details_saveClick();
                };

and he function itself is defined like this

public void btn_details_saveClick()
        {
             //Do stuff
        } 
Now when i run the application, the button is click the button the following error occurs

AndroidRuntime(19059): java.lang.IllegalStateException: Could not find method btn_details_saveClick(View) in a parent or ancestor Context for android:onClick attribute defined on view class Button with id 'btn_details_save'

Please note that this is C# code , which means i am using xamarin ,but the error is Android related not Xamarin.

Thanks
Vuyiswa Maseko,

Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.

C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vimalsoft.com
vuyiswa[at]vimalsoft.com

SuggestionRe: (View) in a parent or ancestor Context for android:onClick attribute defined on view class Button Pin
David Crow30-Aug-17 11:35
David Crow30-Aug-17 11:35 
GeneralRe: (View) in a parent or ancestor Context for android:onClick attribute defined on view class Button Pin
Vimalsoft(Pty) Ltd30-Aug-17 12:08
professionalVimalsoft(Pty) Ltd30-Aug-17 12:08 
QuestionRe: (View) in a parent or ancestor Context for android:onClick attribute defined on view class Button Pin
David Crow31-Aug-17 4:56
David Crow31-Aug-17 4:56 
AnswerRe: (View) in a parent or ancestor Context for android:onClick attribute defined on view class Button Pin
Vimalsoft(Pty) Ltd31-Aug-17 5:00
professionalVimalsoft(Pty) Ltd31-Aug-17 5:00 
AnswerRe: (View) in a parent or ancestor Context for android:onClick attribute defined on view class Button Pin
David Crow31-Aug-17 5:23
David Crow31-Aug-17 5:23 
GeneralRe: (View) in a parent or ancestor Context for android:onClick attribute defined on view class Button Pin
Vimalsoft(Pty) Ltd3-Sep-17 11:49
professionalVimalsoft(Pty) Ltd3-Sep-17 11:49 
SuggestionAndroid Notification by App Pin
Andy_Bell27-Aug-17 7:58
Andy_Bell27-Aug-17 7:58 
QuestionRe: Android Notification by App Pin
David Crow27-Aug-17 14:00
David Crow27-Aug-17 14:00 
AnswerRe: Android Notification by App Pin
Andy_Bell27-Aug-17 21:59
Andy_Bell27-Aug-17 21:59 
QuestionRe: Android Notification by App Pin
David Crow28-Aug-17 3:05
David Crow28-Aug-17 3:05 
AnswerRe: Android Notification by App Pin
Andy_Bell28-Aug-17 4:40
Andy_Bell28-Aug-17 4:40 
GeneralRe: Android Notification by App Pin
Member 1328039729-Aug-17 3:29
Member 1328039729-Aug-17 3:29 
GeneralRe: Android Notification by App Pin
kusuma chowdary22-Sep-17 1:58
kusuma chowdary22-Sep-17 1:58 
QuestionUsing Android class and Xml files as templet Pin
venky.nani9120-Aug-17 21:06
venky.nani9120-Aug-17 21:06 
AnswerRe: Using Android class and Xml files as templet Pin
Richard MacCutchan20-Aug-17 22:55
mveRichard MacCutchan20-Aug-17 22:55 
GeneralRe: Using Android class and Xml files as templet Pin
venky.nani9120-Aug-17 23:56
venky.nani9120-Aug-17 23:56 
AnswerRe: Using Android class and Xml files as templet Pin
David Crow21-Aug-17 4:59
David Crow21-Aug-17 4:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.