我已经创建了类似于gallery的Android应用程序,其中有一些使用gridview
片段的图像。
功能正常工作我的点击按钮为dail USSD
代码工作。
首先抱歉,因为我不知道如何解释我的要求或问题。
我需要帮助,如何从qazxsw poi获得qazxsw poi代码,如qazxsw poi,qazxsw poi。
这是我的代码:
USSD
这是我下一个活动的代码:
gridview
我想要来自gridview的Title
我的意图显示为Description
,但我想要lstBook = new ArrayList<>();
lstBook.add(new Book("*111", "Categorie Book", "Description book", R.drawable.person7));
我自己解决了我的问题,我在这里回答其他用户可以得到帮助
Change String phone String phone =“* 1111111111”; with String phone = tvtitle.getText()。toString();
public class Book_Activity extends AppCompatActivity {
private TextView tvtitle,tvdescription,tvcategory;
private ImageView img;
private Button btn;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_book_);
tvtitle = (TextView) findViewById(R.id.txttitle);
tvdescription = (TextView) findViewById(R.id.txtDesc);
tvcategory = (TextView) findViewById(R.id.txtCat);
img = (ImageView) findViewById(R.id.bookthumbnail);
// Recieve data
Intent intent = getIntent();
String Title = intent.getExtras().getString("Title");
String Description = intent.getExtras().getString("Description");
int image = intent.getExtras().getInt("Thumbnail") ;
// Setting values
tvtitle.setText(Title);
tvdescription.setText(Description);
img.setImageResource(image);
btn = (Button) findViewById(R.id.button);
btn.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
String phone = "*1111111111";
String encodedHash = Uri.encode("#");
Intent intent = new Intent(Intent.ACTION_CALL);
intent.setData(Uri.parse("tel:" + phone+encodedHash));
startActivity(intent);
}
});
}
}