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 9318131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T03:02:21+00:00 2026-06-19T03:02:21+00:00

I want something like that.i have a button and 2 textbox when user put

  • 0

I want something like that.i have a button and 2 textbox when user put their username and password and then click on login button then login action will be performed and then welcome the user and go to another page .my code was like that:

try {
                Connection.Response res = Jsoup.connect("URL")
                        .data("log", "abcd", "pwd", "12345", "wp-submit", "প্রবেশ", "redirect_to", "url", "testcookie", "1")
                        .method(Method.POST)
                        .execute();
                Map<String, String> cookies = res.cookies();

                Document doc2 = Jsoup
                    .connect("new_url")
                    .cookies(cookies)
                    .get();

                s = doc2.text().toString();
                t.setText(s);

            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
                t.setText("no");
            }

But login action cant be successful and here it always shows “no”.
How can i successfully do that???

  • 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-19T03:02:23+00:00Added an answer on June 19, 2026 at 3:02 am

    i think it is threading problem. because your internet request is on main UI-Thread. test this:

    private class AsyncExecution extends AsyncTask<Void, Void, Void>{
        boolean tracker = false;
        String s = "";
        @Override
        protected Void doInBackground(Void... params) {
           try {
               Connection.Response res = Jsoup.connect("http://www.kuetlive.com/wp-login.php")
                            .data("log", "abcd", "pwd", "12345", "wp-submit", "প্রবেশ", "redirect_to", "http://www.kuetlive.com/wp-admin/", "testcookie", "1")
                            .method(Method.POST)
                            .settimeout(60000)//time set for the connection 1 min
                            .execute();
                    Map<String, String> cookies = res.cookies();
    
                    Document doc2 = Jsoup
                        .connect("http://www.kuetlive.com/wp-admin/profile.php")
                        .cookies(cookies)
                        .get();
    
                    s = doc2.text().toString();
                    tracker = true;
    
           } catch (Exception e) {
               // TODO Auto-generated catch block
               Log.e("tag", e.toString());
               tracker = false;
    
           }
         }
      --- // }  // --- i add this by mistake, delete this
    
        @Override
        protected void onPostExecute(Void result) {
           if(tracker){
                t.setText(s);
           }else{
                t.setText("no");
           }
        }
    
    }
    

    and call it as

    new AsyncExecution().execute();
    

    Edited:
    you cannot perform an internet request on main UI-Thread. that is why u need a different thread. now u could implement a simple thread instead of AsyncTask. then why i suggest u to use AyncTask. the answer is, u cannot update your UI from a simple Thread. that is why u need AsyncTask, because AsyncTask gives u flexibility to update UI but execute your method in different Thread beside UI-Thread.

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

Sidebar

Related Questions

I want do something like that: I have form with pictures, when I click
I want to parse a html content that have something like this: <div id=sometext>Lorem<br>
I want to set layout something like What i thought that i will have
I want to have a route that looks something like: www.abc.com/companyName/Controller/Action/Id However, all the
I want to have a template class that looks something like what I have
I have something like this in my code: worker.setObject(queue.poll()); I want a queue that
I want to do something like $('a.filter-link').click(function(e) { e.preventDefault(); var that = $(this), categoryId
Q1. I want to grep something like that: grep -Ir --exclude-dir=some*dirs my-text ~/somewhere but
What a want to do is something like that: declare @id int set @id
I want something that will receive me the processes details, like I receive with

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.