这是一个简单的应用程序,我想让我通过浏览器启动一个特定的URL。你们能否给我一些信息让我们知道这件事,就像我说过的,我已经有了这个按钮,可以在我的应用程序中使用。下面的代码 - 还是让我”知道,如果你有什么事最简单的方法是让按钮打开浏览器到特定的URL
java文件
package reseeveBeta.mpi.dcasey;
import android.app.Activity;
import android.os.Bundle;
public class ReseeveBetaActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}
.XML
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Welcome to Reseeve, tap register to begin account creation" />
<Button
android:id="@+id/button1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Register" />
<EditText
android:id="@+id/editText1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="textMultiLine"
android:text="If you already have and account, please login below" >
<requestFocus />
</EditText>
</LinearLayout>
非常感谢。如果有任何问题,我会报告回来 - 再次感谢! – user1301764 2012-03-29 21:54:23
如果这是你想做的事情,并帮助你,你能接受它作为答案吗? – hundeva 2012-03-30 14:10:33
添加到我的项目后,我无法编译/运行。我应该把它放在哪里? – user1301764 2012-03-30 17:50:52