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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:54:42+00:00 2026-05-24T18:54:42+00:00

Actually I am trying to fetch data from a URL and have to split

  • 0

Actually I am trying to fetch data from a URL and have to split that data string using the split("@") method and have to set that data in TextView.

It’s running without error, but it is showing nothing.

enter code here

package com.androidpeople.view;

import java.io.BufferedReader;
import java.io.IOException;``
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class WebViewExample extends Activity {
    String element1,element2,element3,element4,element5,element6;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        TextView text1=(TextView) findViewById(R.id.textView1);
        TextView text2=(TextView) findViewById(R.id.textView2);
        TextView text3=(TextView) findViewById(R.id.textView3);
        TextView text4=(TextView) findViewById(R.id.textView4);
        TextView text5=(TextView) findViewById(R.id.textView5);
        TextView text6=(TextView) findViewById(R.id.textView6);

        String nextLine;
        URL url = null;
        URLConnection urlConn = null;
        InputStreamReader inStream = null;
        BufferedReader buff = null;

        // Create the URL obect that points
        // at the default file index.html
        if (nextLine !=null){
            String aColors[] = nextLine.split("@");

            element1= aColors[0];
            element2= aColors[1];
            element3= aColors[2];
            element4= aColors[3];
            element5= aColors[4];
            element6= aColors[5];
        }
    }
}

catch(IOException e){
    e.printStackTrace();
}
text1.setText("text is" +element1);
text2.setText("text is" +element2);
text3.setText("text is" +element3);
text4.setText("text is" +element4);
text5.setText("text is" +element5);
text6.setText("text is" +element6);
}

}
  • 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-05-24T18:54:43+00:00Added an answer on May 24, 2026 at 6:54 pm

    I think Split method have to use like this :

     String aColors[] = nextLine.split("\\@");  
    
    instead of
    String aColors[] = nextLine.split("@"); 
    

    Hope it helps.

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

Sidebar

Related Questions

I'm writing a php script that will fetch data from a given URL and
I'm trying to create an application that will fetch data from a web API
I have a Dataset that contains tables from a university database, two(actually more) of
I am trying to fetch the data from a google docs spreadsheet and I
I am trying to fetch and display contents from table.Currently i am running a
Edit--@Uri correctly pointed out that this was an abuse of annotations; trying to actually
I'm using httpclient to download images from a webpage and I'm trying to save
I am trying to insert and update data using 3 prepared statements. There are
we have strange problem, we have single signon and we are trying to fetch
I'm trying to look up user's username using $_GET but not actually seing the

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.