<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:background="#ffe1e0de" >    <ListView        android:id="@+id/listview"        android:layout_width="match_parent"        android:layout_height="match_parent" >    </ListView>    <ImageView        android:id="@+id/imageview"        android:layout_width="match_parent"        android:layout_height="match_parent"         android:src="@drawable/icon"        /></RelativeLayout>

java代码:

import com.example.test.Test1.R;import android.app.Activity;import android.os.Bundle;import android.widget.ListView;public class HelloAndroidActivity extends Activity{        @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.main);        ListView listView = (ListView)findViewById(R.id.listview);        listView.setEmptyView(findViewById(R.id.imageview));    }}

更多相关文章

  1. 编写android拨打电话apk应用实例代码
  2. android 用代码编写linearlayout布局
  3. android延迟进入主界面和点击按钮进入主界面代码
  4. Android使用webview让服务器上的js调用java代码的方法
  5. android闹钟――原代码
  6. android编写访问http的代码
  7. 跟着第二行代码回顾Android--持久化技术

随机推荐

  1. Android蓝牙通讯模块源码(Android蓝牙开发
  2. [Android Studio 权威教程]Android Studio
  3. 关于Android中GestureOverlayView多笔画
  4. Android自动化测试工具实现简述
  5. 调试方法-Unity3D对各个target平台的模拟
  6. Android软件开发之获取通讯录联系人信息(
  7. 一个吊丝android个人开发者的逆袭之路
  8. Android聊天客户端Demo,开源了.基本功能
  9. 再一次在Eclipse下配置Android
  10. [置顶] Android仿微信APP实现源码