2012-07-14 44 views
-3

我有一個按鈕,點擊時我想打開一個畫廊。我將如何做到這一點?你如何從一個按鈕打開一個畫廊?

+0

您可以通過從Stack Overflow中搜索來找到幾個答案。例如,這[線程](http://stackoverflow.com/questions/6016000/how-to-open-phones-gallery-through-code)。 我希望它可以幫助你。 – naf 2012-07-14 20:56:31

回答

1

這裏已經有question了。您需要製作一個Intent。以下是該答案的代碼:

Intent intent = new Intent(); 
intent.setType("image/*"); 
intent.setAction(Intent.ACTION_GET_CONTENT); 
startActivityForResult(Intent.createChooser(intent, "Select Picture"),SELECT_IMAGE); 
+0

我試過但我沒有工作 – brian 2012-07-14 21:01:11

+1

當你嘗試過時發生了什麼? – Hassan 2012-07-14 21:02:56

+0

沒有,如果你能幫助你可以去這裏http://stackoverflow.com/questions/11489781/trouble-opening-the-gallery#comment15175619_11489781 – brian 2012-07-15 07:38:02

相關問題