android没有显示标题栏,安卓标题栏为什么没有显示

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

用Eclipse开发的APP,其中一个Activit的标题栏没有显示,但没对Activity做过任何配置。由于不知道哪里出问题,下面把Activity的java文件、布局文件和Mainfest全部放出来

======================

Activity.java

------------------

package com.example.RemoteControl;

import java.util.ArrayList;

import java.util.HashMap;

import java.util.List;

import java.util.Map;

import android.app.Activity;

import android.content.Intent;

import android.database.Cursor;

import android.os.Bundle;

import android.view.Menu;

import android.view.MenuItem;

import android.view.View;

import android.view.View.OnClickListener;

import android.widget.AdapterView;

import android.widget.ArrayAdapter;

import android.widget.Button;

import android.widget.ListView;

import android.widget.SimpleAdapter;

import android.widget.AdapterView.OnItemClickListener;

public class AreasSettingActivity extends Activity implements OnClickListener {

ListView lsvAreas;

Button btnAdd;

Button btnEdit;

Button btnRefresh;

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_areas_setting);

lsvAreas = (ListView) findViewById(R.id.lsvAreas);

btnAdd = (Button) findViewById(R.id.btnAdd);

btnEdit = (Button) findViewById(R.id.btnEdit);

btnRefresh = (Button) findViewById(R.id.btnRefresh);

btnAdd.setOnClickListener(this);

btnEdit.setOnClickListener(this);

btnRefresh.setOnClickListener(this);

lsvAreas.setOnItemClickListener(new OnItemClickListener() {

@Override

public void onItemClick(AdapterView> parent, View view,

int position, long id) {

// TODO Auto-generated method stub

ListView list = (ListView) parent;

@SuppressWarnings("unchecked")

String area = (String) list.getItemAtPosition(position);

Intent intent = new Intent();

intent.setClass(AreasSettingActivity.this,

EquitmentsControlActivity.class);

intent.putExtra("area", area);

startActivity(intent);

}

});

refresh();

}

private List getAreasData(Cursor cursor) {

List list = new ArrayList();

list.add("全部设备");

while (cursor.moveToNext()) {

list.add(cursor.getString(cursor.getColumnIndex("area")));

}

return list;

}

@Override

public void onClick(View v) {

// TODO Auto-generated method stub

switch (v.getId()) {

case R.id.btnAdd:

// Intent intent = new Intent();

// intent.setClass(EquitmentsControlActivity.this,

// EquitmentAddActivity.class);

// startActivity(intent);

break;

case R.id.btnEdit:

break;

case R.id.btnRefresh:

refresh();

break;

}

}

private void refresh() {

// TODO Auto-generated method stub

Cursor cursor = EquitmentsAccess.queryEquitmentsByColumnName("area",

true);

lsvAreas.setAdapter(new ArrayAdapter(this,

android.R.layout.simple_list_item_1, getAreasData(cursor)));

}

}

===============================

=

=

=================================

布局文件

-----------------------

xmlns:tools="http://schemas.android.com/tools"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:orientation="vertical"

android:paddingBottom="@dimen/activity_vertical_margin"

android:paddingLeft="@dimen/activity_horizontal_margin"

android:paddingRight="@dimen/activity_horizontal_margin"

android:paddingTop="@dimen/activity_vertical_margin"

tools:context="com.example.RemoteControl.EquitmentControlActivity" >

android:id="@+id/lsvAreas"

android:layout_width="match_parent"

android:layout_height="0dp"

android:layout_weight="12" >

android:layout_width="match_parent"

android:layout_height="0dp"

android:layout_weight="1"

android:orientation="horizontal"

style="?android:attr/buttonBarStyle" >

android:id="@+id/btnAdd"

android:layout_width="0dp"

android:layout_height="wrap_content"

android:layout_weight="1"

android:text="@string/strAdd"

style="?android:attr/buttonBarButtonStyle" >

android:id="@+id/btnEdit"

android:layout_width="0dp"

android:layout_height="wrap_content"

android:layout_weight="1"

android:text="@string/strEdit"

style="?android:attr/buttonBarButtonStyle" >

android:id="@+id/btnRefresh"

android:layout_width="0dp"

android:layout_height="wrap_content"

android:layout_weight="1"

android:text="@string/strRefresh"

style="?android:attr/buttonBarButtonStyle" >

==================================

=================================

Mainfest文件

-------------------------------

package="com.example.RemoteControl"

android:versionCode="1"

android:versionName="1.0" >

android:minSdkVersion="14"

android:targetSdkVersion="21" />

android:allowBackup="true"

android:icon="@drawable/ic_launcher"

android:label="@string/app_name"

android:theme="@style/AppTheme" >

android:name=".LoginActivity"

android:label="@string/app_name" >

android:name=".MainActivity"

android:label="@string/title_activity_main" >

android:name=".EquitmentsControlActivity"

android:label="@string/title_activity_equitment_control" >

android:name=".EquitmentAddActivity"

android:label="@string/title_activity_add_equitment" >

android:name=".EquitmentConfigActivity"

android:label="@string/title_activity_equitment_config" >

android:name=".AreasSettingActivity"

android:label="@string/title_activity_areas_setting">

===============================

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值