开发者

How do i draw image inside onComplete method?

I have following scenario: After a user is successfully authenticated via facebook credentials some image appears on the screen and clicking on it will post the url of the image as well as some text to the facebook wall.

For this i am referring the example given in facebook documentation. Under facebook.authorize onComplete method i want to draw some images. I have added the following code:

 public void onComplete(Bundle values) {
            ImageView imgView = new ImageView(MyGreatActivity.this);
            int id = getResources().getIdentifier("img1", "drawable", getPackageName());
            imgView.setImageResource(id);
 }

But when i ran the example after successful authentication no image 开发者_StackOverflowappears.

Please guide me on this

Thanks,

Pankaj


You need to add the ImageView to the layout, e.g.

myLinearLayout.addView (imgView);


create Layoutparams for ur Imageview, then set that params to ur imageview hope this work

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜