Android Error
升级AndroidStudio3.0 Unable to resolve dependency for ':app@betaUnitTest/compileClasspath问题解决
app下build.gradle
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
sourceSets {
main {
jniLibs.srcDirs = ['libs']
res.srcDirs =
[
'src/main/res/layout/viewpage',
'src/main/res/layout/recycler',
'src/main/res/layout/login',
'src/main/res'
]
}
}
}
module下build.gradle
buildTypes {
release {
minifyEnabled false
}
sourceSets {
}
}
android studio Error:(1, 1) 错误: 非法字符: '\ufeff' 解决方案
INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries
在AndroidStudio 的build.gradle(Moudule:app) 文件中
android{
splits {
abi {
enable true
reset()
include 'x86', 'armeabi-v7a','x86_64'
universalApk true
}
}
Error:Unsupported method: BaseConfig.getApplicationIdSuffix().
将 build.gradle 中的
classpath 'com.android.tools.build:gradle:1.1.1'
改成:
classpath 'com.android.tools.build:gradle:2.3.2'
error: style attribute '@android:attr/windowEnterAnimation' not found.
在Project/gradle.properties中添加 android.enableAapt2=false
无法实例化类:android.support.v7.widget.SearchView的问题?
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" >
<item android:id="@+id/action_search"
android:title="@string/search"
android:icon="@drawable/ic_action_search"
app:showAsAction="ifRoom|collapseActionView"
app:actionViewClass="android.support.v7.widget.SearchView" />
</menu>
如何利用PopupWindow实现弹出菜单并解决焦点获取以及与软键盘冲突问题
//初始化弹出菜单
popWindow = new PopupWindow(view, WindowManager.LayoutParams.FILL_PARENT,WindowManager.LayoutParams.WRAP_CONTENT,false);
//设置可以获取焦点,否则弹出菜单中的EditText是无法获取输入的
popWindow.setFocusable(true);
//这句是为了防止弹出菜单获取焦点之后,点击activity的其他组件没有响应
popWindow.setBackgroundDrawable(new BitmapDrawable());
//防止虚拟软键盘被弹出菜单遮住
popWindow.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
//在底部显示
popWindow.showAtLocation(this,Gravity.BOTTOM, 0, 0);
软键盘: 为文本输入框指定软键盘类型和软键盘回车键图标设置
str1.equalsIgnoreCase(str2);
com.google.gson.JsonSyntaxException: java.lang.NumberFormatException:
E/HttpRequest: run: failed to connect to /192.168.1.115 (port 8080) from /192.168.232.2 (port 60854) after 10000ms
关闭防火墙
Android在ListView中嵌套一个GridView时只显示一行的原因及解决方法
public class NoScrollGridView extends GridView {
public NoScrollGridView(Context context) {
super(context);
}
public NoScrollGridView(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2,MeasureSpec.AT_MOST);
super.onMeasure(widthMeasureSpec, expandSpec);
}
}