-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAddtoShelf.java
More file actions
50 lines (35 loc) · 1.44 KB
/
AddtoShelf.java
File metadata and controls
50 lines (35 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package com.android.bookbook.activity;
import com.android.bookbook.R;
import com.android.bookbook.model.BookInfo;
import android.app.Activity;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
public class AddtoShelf extends Activity{
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.addtoshelf);
TextView bookName=(TextView)findViewById(R.id.bookNameTextview);
TextView authorName=(TextView)findViewById(R.id.authorTextview);
TextView ISBNview =(TextView)findViewById(R.id.ISBNTextview);
ImageView bookImage =(ImageView)findViewById(R.id.BookImage);
Button addToShelf =(Button)findViewById(R.id.addToShelf);
BookInfo bookinfo=(BookInfo)getIntent().getExtras().get("bookinfo");
String imagePath = "/sdcard/shuji/images/"+bookinfo.getISBN()+".jpg";
bookImage.setImageBitmap(BitmapFactory.decodeFile(imagePath));
bookName.setText(bookinfo.getBookName());
authorName.setText("作者: "+bookinfo.getAuthor());
ISBNview.setText("ISBN: "+bookinfo.getISBN());
addToShelf.setOnClickListener(new OnClickListener(){
@Override
public void onClick(View v) {
}
});
}
}