"去执行"一个Android的API类打开的.class文件,而不是的.java [英] "Go to implementation" of an Android API class opens .class file, not .java

查看:196
本文介绍了"去执行"一个Android的API类打开的.class文件,而不是的.java的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在开发Android的工作室0.4.0的应用程序(但这个问题也发生在更早版本),当我尝试访问使用IDE的快捷方式一个Android特有的类的实现去实现它打开了类的.class文件,而不是的.java。

I'm developing an app in Android Studio 0.4.0 (but this issue happened also on earlier versions), and when I try to access the implementation of an Android-specific class using the IDE's shortcut "Go to implementation", it opens the .class file of that class, and not the .java.

在另一台计算机和不同的项目,我敢肯定,快捷方式打开java文件,这是需要的,因为我可以看到实际的执行code,注释和javadoc。

In another computer and different project, I'm sure that shortcut opens the java file, which is desired because I can see the actual implementation code, comments, and javadoc.

例如,我有这个类:

package com.example;
...
import android.app.Fragment;

public class MyFragment extends Fragment {
    ...
}

当我在片段插入符号和做去实现,它会打开 $ ANDROID_SDK /平台/ Android为19 /机器人。罐子!/android/app/Fragment.class 。预期的行为应该是开放 $ ANDROID_SDK /来源/ Android为19 /安卓/ APP / Fragment.java (或者其它任何东西在于正确Fragment.java文件)。

When I have the caret on Fragment and do "Go to implementation", it opens $ANDROID_SDK/platforms/android-19/android.jar!/android/app/Fragment.class. The expected behaviour should be to open $ANDROID_SDK/sources/android-19/android/app/Fragment.java (or where ever else lies the correct Fragment.java file).

在SDK管理器,我敢肯定,我下载的来源为Android SDK,API 19和API 17.我的清单文件中指出:

In the SDK manager, I'm sure I downloaded the sources for Android SDK, API 19 and API 17. My Manifest file states:

<uses-sdk
    android:minSdkVersion="17"
    android:targetSdkVersion="17"
    />

改变目标SDK来19没有任何影响。

Changing the target SDK to 19 has no effect.

任何想法?

推荐答案

但不支持连接源罐或目录库包含但在摇篮为基础的Andr​​oid Studio项目。你可以用它来跟踪进度最接近的错误是:

Attaching source jars or directories to included libraries isn't supported yet in Gradle-based Android Studio projects. The closest bug you can use to track progress is:

HTTPS://$c$c.google。 COM / P /安卓/问题/详细信息?ID = 59220

这篇关于&QUOT;去执行&QUOT;一个Android的API类打开的.class文件,而不是的.java的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆