我制作节目。我的程序完全在bluestacks工作,但在我的手机部分我的程序不起作用。这部分出现了问题显示两张图片和一张纸条的对话框。在我的手机中显示失败原因的按摩是:
“不幸的是,(我的节目名称)已停止。”
我的程序的一部分是在bluestack和手机中工作,然后通过点击一个问题创建的项目,是:
public class Introduction_map_Activity extends AppCompatActivity {
final Context context = this;
private TextView title_custom;
private ImageButton imageButton_place;
private ImageButton imageButton_place_map;
private TextView textView_place_information;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
getSupportActionBar().setCustomView(R.layout.layout_custom_title);
title_custom = (TextView)findViewById(R.id.title_custom);
title_custom.setText(R.string.introduction_map);
setContentView(R.layout.activity_introduction_map);
final Dialog dialog = new Dialog(context);
dialog.setContentView(R.layout.dialog_place_information);
imageButton_place = (ImageButton) dialog.findViewById(R.id.ImageButton_place);
imageButton_place_map = (ImageButton) dialog.findViewById(R.id.ImageButton_place_map);
textView_place_information = (TextView) dialog.findViewById(R.id.TextView_place_information);
ImageView image_seraglio = (ImageView) findViewById(R.id.imageView_seraglio);
TextView text_seraglio = (TextView) findViewById(R.id.textView_seraglio);
ImageView image_veranda = (ImageView) findViewById(R.id.imageView_veranda);
TextView text_veranda = (TextView) findViewById(R.id.textView_veranda);
image_seraglio.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dialog.setTitle(R.string.seraglio_name);
imageButton_place.setImageResource(R.drawable.seraglio_pic);
textView_place_information.setText(R.string.seraglio_information);
imageButton_place_map.setImageResource(R.drawable.seraglio_pic);
dialog.show();
}
});
text_seraglio.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dialog.setTitle(R.string.seraglio_name);
imageButton_place.setImageResource(R.drawable.seraglio_pic);
textView_place_information.setText(R.string.seraglio_information);
imageButton_place_map.setImageResource(R.drawable.seraglio_pic);
dialog.show();
}
});
image_veranda.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dialog.setTitle(R.string.veranda_name);
imageButton_place.setImageResource(R.drawable.seraglio_pic);
textView_place_information.setText(R.string.veranda_information);
imageButton_place_map.setImageResource(R.drawable.seraglio_pic);
dialog.show();
}
});
text_veranda.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dialog.setTitle(R.string.veranda_name);
imageButton_place.setImageResource(R.drawable.seraglio_pic);
textView_place_information.setText(R.string.veranda_information);
imageButton_place_map.setImageResource(R.drawable.seraglio_pic);
dialog.show();
}
});
布局此活动:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.rb.musalla.Introduction_map_Activity">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="right"
android:background="@color/colorAccent">
<ImageView
android:id="@+id/imageView_seraglio"
android:layout_width="74dp"
android:layout_height="match_parent"
android:contentDescription="@string/seraglio_name"
app:srcCompat="@mipmap/ic_launcher" />
<TextView
android:id="@+id/textView_seraglio"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/seraglio_name"
android:textSize="@dimen/_10sdp"
android:gravity="center" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="fill"
android:weightSum="1"
android:background="@color/colorPrimary">
<TextView
android:id="@+id/textView_veranda"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="@string/veranda_name"
android:textSize="@dimen/_10sdp"
android:layout_weight="0.9"
android:gravity="center"/>
<ImageView
android:id="@+id/imageView_veranda"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.1"
android:src="@mipmap/ic_launcher"
android:contentDescription="@string/veranda_name"/>
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
和对话框布局是:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/_10sdp"
android:background="@color/custom1"
android:orientation="vertical">
<ScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<ImageButton
android:id="@+id/ImageButton_place"
android:layout_width="match_parent"
android:layout_height="@dimen/_100sdp"
android:background="@color/custom1"
android:scaleType="centerInside" />
<TextView
android:id="@+id/TextView_place_information"
android:layout_width="match_parent"
android:layout_height="@dimen/_150sdp"
android:padding="@dimen/_5sdp"/>
<ImageButton
android:id="@+id/ImageButton_place_map"
android:layout_width="match_parent"
android:layout_height="@dimen/_100sdp"
android:background="@color/custom1"
android:scaleType="fitCenter" />
</LinearLayout>
</ScrollView>
</LinearLayout>
另外我的手机Android版本是上层 bluestacks安卓版。
日志猫:
03-23 11:19:11.600 580-580 /? E / installd:eof 03-23 11:19:11.600 580-580 /? E / installd:无法读取大小
为您的导游服务。