Recepty, články, nápady, programování. Dříve dum-zahrada, finance, internet a know-how.okhelp.cz Pro lepší výsledky hledání používejte i diakritiku.

Class File Editor - Source not found - Change Attached Source - Eclipse


The source attachment does not contain the source for the file TextWatcher.class.
You can change the source attachment by clicking Change Attached Source below:

You have to add JDK src.zip path to dialog as on image below.
[caption id="attachment_1091" align="alignleft" width="282" caption="class file editor source not found Eclipse warning"][/caption]

Or go to Project > Properties > Java Build Path > Libraries
Expand JRE System Library. Expand rt.jar.
Select Source attachment and double click or Edit.
Type path the source code file (External File…) and press OK.

[caption id="attachment_1094" align="alignleft" width="300" caption="Java project build path"][/caption]

Or type path in Java JRE definition

[caption id="attachment_1105" align="alignleft" width="300" caption="Java JRE deifiniton path in Eclipse"][/caption]

How open String.class or others keywords definition with Eclipse.

Now if mouse move about keywords String or F3 on keywords and press button in yellow field will opened String.class
Java Eclipse intellisense


397LW NO topic_id


Další témata ....(Topics)


How to make a horizontal line in Android application example code | how-to-make-a-horizontal-line-in-android-application-example-code

In html is horizontal line a tag br. In Android source code you can use a View as xml example bellow.


Download file from root Android device Windows | download-file-from-root-android-device-windows

Download file from Android device using Android Studio


C:\Users\user>c:\Users\user\AppData\Local\Android\sdk\platform-tools\adb shell (press Enter)
shell@Kraft-A6000:/ $ 
shell@Kraft-A6000:/ $ su (Enter)
root@Kraft-A6000:/ #
root@Kraft-A6000:/ # su -c "chmod 777 /data" (Enter)
root@Kraft-A6000:/ # su -c "chmod 777 /data/data" (Enter)
root@Kraft-A6000:/ # su -c "chmod 777 /data/data/com.your_package" (Enter)
root@Kraft-A6000:/ # su -c "chmod 777 /data/data/com.your_package/databases" (Enter)
root@Kraft-A6000:/ # su -c "chmod 777 /data/data/com.your_package/databases/database_name.db" (Enter)

  • Open Android Studio -> Tools -> Android -> Android Device Monitor (meybe some message box, minimalize all windows to find message box - close message box )
  • Pull data from Explorer

Date: 13.07.2020 - 08:23

Import project Android Eclipse | import-project-android-eclipse

Import a new Android project for example downloaded from internet via Eclipse into project folder.

  1. Right click into projects explorer in Eclipse and select Import

  2. Android

  3. Existing Android Code Into Workspace

  4. Root Directory (select folder of downloaded project)

  5. Check your downloaded project

  6. Check Copy project into Workspace

  7. Finish (press)


View getId is null Android | view-getid-is-null-android

If you create a button or view programmatically with OnClickListener you can set a tag key before button in parent layout is added.
And get correct button by this tag getTag() instead getId() in OnClickListener etc.

Button button = new Button(getApplicationContext());
int idOfButton = button.getId(); // return -1

String sTag = (String) button.getTag(); // return "my_button"


Eclipse "id cannot be resolved or is not a field” error Android | eclipse-id-cannot-be-resolved-or-is-not-a-field-error-android

"id cannot be resolved or is not a field” error
If you copy project to workspace or some code from other project you can get this error.

Try remove or add import your R file:

import com.example.app.R

Check xml files.
Clean project by menu Project-Clean

Maybe you have to create new project end copy old source files to new project folders.

Editace: 2014-02-15 20:46:40
Počet článků v kategorii: 397

11 Share