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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:01:25+00:00 2026-05-25T02:01:25+00:00

I am getting this strange error: R.id cannot be resolved on lines: WebView myWebView

  • 0

I am getting this strange error:

  R.id cannot be resolved 

on lines:

 WebView myWebView = (WebView) findViewById(view.R.id.webview);
 myWebView.loadUrl(s);

I tried to clean the project and restart it.
here is my code:

public class NewsActivity  extends ListActivity {
 public ReadXML ReadXML=new ReadXML();
 public  ArrayList<String> ynetList =new ArrayList<String>();

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);

for(int i=0;i<ReadXML.hadashotListItems.size();i++)
ynetList.add(ReadXML.hadashotListItems.get(i).title+"\n"+ReadXML.hadashotListItems.get(i).pubDate);

      setListAdapter(new ArrayAdapter<String>(this, R.layout.list_item, ynetList));
    //  setContentView(R.layout.main);
      ListView lv = getListView();
      lv.setTextFilterEnabled(true);

      lv.setOnItemClickListener(new OnItemClickListener() {
        public void onItemClick(AdapterView<?> parent, View view,int position, long id) {
          // When clicked, show a toast with the TextView text
        String s=   ReadXML.hadashotListItems.get(position).link;

        WebView myWebView = (WebView) findViewById(view.R.id.webview);
        myWebView.loadUrl(s);
    //


      //Toast.makeText(getApplicationContext(((TextView)view).getText(),Toast.LENGTH_SHORT).show();
        }
      }
      );
    }}

my xml code is:
list_item.xml

  <?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="10dp"
android:textSize="15sp" >
</TextView>


<WebView  xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>

</LinearLayout>

thanks for help!

  • 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-25T02:01:26+00:00Added an answer on May 25, 2026 at 2:01 am

    The message R.id cannot be resolved means that the R class is not properly built or at least is not according to your file list_item.xml as it defines an id.

    The probable causes are the following:

    • Eclipse is lost and does not manage to build your project properly (this happens sometime): try to clean and rebuild your project (menu project/clean of Eclipse).

    • Sometimes this is not sufficient either, so try to

      • clean you project
      • modify your AndroidManifest.xml by adding a blank char in it
      • Close your project in Eclipse
      • Open it again
      • Re-clean it and build it

    • Your file list_item.xml is not in the right directory. It should be in the directory [project_root]/res/layout

    • You have an Android framework installation problem. Check in the menu “Windows/Android SDK and ADT manager” of Eclipse whether everything is fine.

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

Sidebar

Related Questions

Trying to install pear package and keep getting this strange error. Can you shed
I'm getting a strange syntax error when I run this in VB: SQLString =
Getting this strange error. In C#, I write to a file (txt) whose location
I am getting this strange error in gdb and i'm unable to trace the
On my site http://www.mediadeals.co.uk , I'm getting this strange error. The site was working
I am trying to compile large C++ project and I am getting this strange
I'm getting a strange error in VS 2010. I have a project set to
I am extremely confused why I am getting this strange error all the sudden:
I'm getting this strange error when I try connect to my WCF with webHttpBinding
I am getting a strange incorrect indentation error that I cannot track down. As

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.