0

今、andorid アプリケーションを作成しようとしています。以下のエラーを参照してください。

http://k1310.hizliresim.com/1g/l/tpvwu.png

これはメインコードです:

package com.hayat.goz;

import android.app.Activity;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class Teste_Basla_1 extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.teste_basla_1);
         setRequestedOrientation (ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
        final Button teste_basla = (Button)findViewById(R.id.button1);

         teste_basla .setOnClickListener(new View.OnClickListener() {

                public void onClick(View v) {

                    Intent a = new Intent(Teste_Basla_1.this, Gorme_testi_1.class);

                    startActivity(a);

                    finish();

                }});        

    }

    @Override  
    public void onBackPressed() {

           Intent a = new Intent(Teste_Basla_1.this, MainActivity.class);

            startActivity(a);

               finish();

    }    




}

これは XML コードです。

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" 
    android:background="@drawable/uyarii">

    <Button
        android:id="@+id/button1"
        android:layout_width="90dp"
        android:layout_height="90dp"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        android:layout_marginBottom="54dp"
        android:background="@drawable/testebaslaacilis"/>

</RelativeLayout>

アプリケーション内の画像が解析できるほど小さくないと思います。PhotoShop で縮小できません。この問題をコーディングで解決する必要がありますが、どうすればよいかわかりません。

アイデアを教えてください。皆さん、ありがとうございました...

4

2 に答える 2

0

エラーが示すように、ビットマップ サイズがデバイスのヒープ サイズに対して大きすぎます。android のガイド方法を参照してください

于 2013-10-18T17:42:26.723 に答える
0

以下が役立つかどうかを確認してください。

http://www.androiddevelopersolution.com/2012/09/bitmap-how-to-scale-down-image-for.html

于 2013-10-18T19:12:37.913 に答える