1

所以基本上我在 onCreate 方法中创建了一个 URL,我想在我点击一个按钮时传递它。URL 已创建,但我无法将其发送到 NeXT 活动,因为它只是在 oncreate 方法中。我应该怎么办 ?

4

1 回答 1

1

Create a class variable and assign it the url in the onCreate.

   public class MyActiviy extends Activty {
       private URL myURL;

       public static void onCreate(Bundle bundle) {
           myURL={insert new URL};
       }
   }
于 2011-01-15T00:25:54.413 回答