好的,因此我无法按照Android Studio的要求进行任何开发。我的所有项目到处都是错误,这些错误由Android Studio引起。
注意:我的文件是正确的,这是另一个问题,因为即使我从google代码中导入某些内容也会出错。
当我导入一个项目时,一切都很好,但是在建立索引等之后,所有突然的事情都是红色的,不应该这样。
我的错误例如是:
button1.setOnLongClickListener(new View.OnLongClickListener()
{
....
....
}
Run Code Online (Sandbox Code Playgroud)
好吧,应该不是错误,但: cannot resolve symbol setOnLongClickListener
另一个例子:
button1=(Button) findViewById(R.id.button1);
Run Code Online (Sandbox Code Playgroud)
我将这个确切的代码用于其他按钮,似乎是正确的,我一直使用此行,直到我的Android Studio决定给我一些辛苦的时间,这行很好,此行充满了错误,它们是:
Unknown class: 'button1' , invalid method declaration; return type required, missing method body, or declare abstract
Run Code Online (Sandbox Code Playgroud)
我尝试了20种不应该发生的错误:
我的模块:app build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion '22.0.1'
defaultConfig {
applicationId "firstappdevelopments.david.reactiontime"
minSdkVersion 9
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), …Run Code Online (Sandbox Code Playgroud) android manifest gradle android-manifest android-gradle-plugin
你好:)我想改变我的应用程序,因此它将具有Material主题,所以..我安装了新的adt,在sdk管理器上更新所有,并做了这些东西:
我打开了一个新文件 - /res/values/styles.xml并在那里使用了这段代码:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- your app's theme inherits from the Material theme -->
<style name="AppTheme" parent="android:Theme.Material">
<!-- theme customizations -->
</style>
</resources>
Run Code Online (Sandbox Code Playgroud)
在AndroidManifest我使用了这段代码:
<uses-sdk
android:minSdkVersion="19"
android:targetSdkVersion="20" />
Run Code Online (Sandbox Code Playgroud)
在styles.xml我收到此错误:
"错误:检索项目的父项时出错:找不到与给定名称'android:Theme.Material'匹配的资源."
我需要改变什么?
有一些应用程序,如"sbgamehacker"或"gamekiller",这些应用程序在后台运行,您可以暂停另一个应用程序,转到这些应用程序并输入暂停应用程序中存在的值并更改它,例如,在我的游戏中,我有硬币,我的硬币用于购买东西,如果我有50个硬币,我可以去游戏杀手或sbgamehacker并输入50,然后它将能够将其更改为933939硬币,我该如何防止我的应用程序被骗了?
我的硬币通过的1跳涨,因此,如果任何人有一个想法,以检查是否币上升了1000跳转所以它会退出应用程序,并发送一条消息,停止黑客.