0

ここでカメラアプリを作成しています。画像をクリックして ImageView に表示することができました。クリックすると別のページに移動する ImageButton があります。もう一方のページでは、Instagram のようにスクロール可能な画像のセットでその画像を表示したいと考えています。しかし、その画像を他のxmlファイルにロードできません。助けてください。

コード:

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.image_select);

    // Image clicked...
    ImageView ivPic = (ImageView) findViewById (R.id.ivPic);

    // Image button to go to next page...
    ImageButton ib = (ImageButton) findViewById(R.id.ibNext);

    // Not sure if this is right.....
    Drawable iv = ivPic.getDrawable();


    ib.setOnClickListener(new View.OnClickListener() {

        public void onClick(View v) {
            // TODO Auto-generated method stub
            startActivity(new Intent("com.rating.bar.EFFECTS"));
        }
    });

}}

他のクラスでは、このクラス変数を作成しましたが、iv (画像ビューのドローアブルを保持する) を使用できません。私が思う整数のみを受け入れます。私は何をすべきか?

4

1 に答える 1

0

imagebutton で画像の URI/パスを読み取り、次のアクティビティを呼び出すインテントのエクストラに追加し、次のアクティビティでエクストラを読み取ります。

于 2012-08-05T09:26:46.060 に答える