Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8129507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T08:20:09+00:00 2026-06-06T08:20:09+00:00

On LoginClick I want to run the user validation in the background while my

  • 0

On LoginClick I want to run the user validation in the background while my ViewSwitcher switches over to the ProgressBar. I am having difficulty implementing the AsyncTask.

OnClick EventHander:

void LoginClick (Object o, EventArgs e)
{
    _v.ShowNext ();
    LoginUser lu = new LoginUser (this, _user.Text, _pw.Text);
    lu.Execute ("run");
}

LoginUser Class:

class LoginUser: AsyncTask
{
    private readonly string _userName;
    private readonly string _password;
    private readonly Context _context;
            private User user;

    public LoginUser (Context context, string userName, string password)
    {
        _context = context;
        _userName = userName;
        _password = password;
    }

    protected override Java.Lang.Object DoInBackground (Java.Lang.Object[] @params)
    {
        WS ws = new WS ();
        user = ws.validateUser (_userName, _password);
        return true;          
    }

    protected override void OnPostExecute (Java.Lang.Object result)
    {
        Toast.MakeText (_context, user.Market, ToastLength.Long).Show ();
    }
}

But when I build the project, I get a build error “LoginUser.DoInBackground is marked as an override but no suitable method found to override.”

UPDATE: So MonoDevelop is a little different in extending AsyncTask Class. Pretty much everywhere that I have my User class, I needed to put Java.Lang.Object. I can now build without any errors. However, now the app simply crashes immediately upon LoginClick.

E/mono    (18020): Unhandled Exception: Java.Lang.NoClassDefFoundError: Exception of type 'Java.Lang.NoClassDefFoundError' was thrown.
E/mono    (18020):   at Android.Runtime.JNIEnv.FindClass (System.String classname) [0x00000] in <filename unknown>:0 
E/mono    (18020):   at Android.Runtime.JNIEnv.FindClass (System.Type type) [0x00000] in <filename unknown>:0 
E/mono    (18020):   --- End of managed exception stack trace ---
E/mono    (18020): java.lang.NoClassDefFoundError: cpec_fm.LoginUser
E/mono    (18020):  at mono.android.view.View_OnClickListenerImplementor.n_onClick(Native Method)
E/mono    (18020):  at mono.android.view.View_OnClickListenerImplementor.onClick(View_OnClickListenerImplementor.java:29)
E/mono    (18020):  at android.view.View.performClick(View.java:3110)
E/mono    (18020):  at android.view.View$PerformClick.run(View.java:11934)
E/mono    (18020):  at android.os.Handler.handleCallback(Handler.java:587)
E/mono    (18020):  at android.os.Handler.dispatchMessage(Handler.java:92)
E/mono    (18020):  at android.os.Looper.loop(Looper.java:132)
E/mono    (18020):  at android.app.ActivityThread.main(ActivityThread.java:4143)
E/mono    (18020):  at java.lang.reflect.Method.invokeNative(Native Method)
E/mono    (18020):  at java.lang.reflect.Method.invoke(Method.java:491)
E/mono    (18020):  

Original Code Updated Above.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T08:20:11+00:00Added an answer on June 6, 2026 at 8:20 am

    So just opened in Visual Studio and deployed and it works. So far have been very disappointed by MonoDevelop.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having XML in wsdl format, now i want to change it's encoding
I'm trying to animate a background image to move down a set amount of
I have a button which needs to run a javascript function when clicked. The
I'm writing complex application where are server and client application, if i want to
I have a problem while trying to render a partial action on my layout.
' i have a javascript function that im trying to trigger and run. here
I'm trying to make a function that checks if the user is logged in.
I'm working on a simple login form. When the user clicks on the Login
I am having trouble clicking or interacting with some page elements. They seem like
I want to take the entered value of a textbox to a variable in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.