80,350
社区成员
发帖
与我相关
我的任务
分享
package com.example.administrator.demo_imagebutton;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="2dp"
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:paddingTop="2dp"
>
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:src="@drawable/sound_on" />
</RelativeLayout>
确实如此,不放到V24包就好了。为什么V24包就不适配,是不是我手机的安卓版本太低了?是安卓5 我感觉是你的 资源图片放到了V24 包 但是你的手机 不适配 找不到资源文件
我感觉是你的 资源图片放到了V24 包 但是你的手机 不适配 找不到资源文件
数据线连接真机,LogCat是输出什么错误呢。
看日志吧,日志肯定很明显的告诉你了。
闪退 报什么错误
报的什么错,贴出来
Android 之 HTTP 读取网上文件 和 图片
http://www.verejava.com/?id=17476835806637
看下AndroidManifest.xml有没有那个activity 声明