0

I am coding on Eclipse-ADT , right now there are too many xlm files and classes in project. When i want to add some code related to the xml members eclipse stop not responding for about 4-5 minutes. I think the problem is on xml search or verification but i am not sure.

For example , to add button , i write Button button1=(Button)findViewById(R.id.button1) while coding this , there is no problem before (R.id.button1) , but when i write R.id.button1 eclipse crashes.

I searched the related questions on stackoverflow but couldnt manage the find the problem. P.S : My original project was somewhere else on computer , if i choose the workspace as original locaiton , my project becomes invisible , so i decided to create a new workspace and import my original project. This may cause a problem but any suggestion how to handle it ?

tshepang
  • 10,772
  • 21
  • 84
  • 127
  • If you haven't already done so, make sure you are up to date with SDK Tools and the plugin,i.e. version 22.6.2. Some earlier versions were slow on xml editing, see http://stackoverflow.com/questions/22297573/ – NickT Apr 20 '14 at 14:51

1 Answers1

0

I think it crashes even if it's just not responding. Maybe you don't have any buttons in the current Activity named "button1".

In the XML file, open the code interface and change respective button_id tag to "button1".

In the .java file change the setContentView tro "main" and add the:

(Button) findViewById(R.id.button1);

in your "main".

Teodor Ciuraru
  • 2,949
  • 1
  • 27
  • 33
  • All codes are ok , there is no error and all buttons and imports are defined.The code works but when it comes to work on an xml member definition eclipse doesnt respond for about 5 minutes and then continues. – user3536338 Apr 20 '14 at 13:58