Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Eclipse の Android 以外のプロジェクト (Java プロジェクトのみ) でいくつかの Android クラスにアクセスする必要があります。
私が実際に行う必要があること:
Class c = Class.forName("android.widget.Button");
明らかに、私は java.lang.ClassNotFoundException: android.widget.Button を取得します
やりたいことはできる?
eclipse で Android Classpath Container を追加しないでください。代わりに、個々の android.jar を追加してください。最も高い Android バージョンを追加し、ビルド スクリプトの場所を保存する local.properties ファイルを作成することをお勧めします。