我有一个Button的问题。单击它时不会打开URL。不知道是什么问题。如果有人能提供帮助,我将不胜感激。感谢。
public class Tours implements Serializable {
private String mId;
private String mTitle;
private String mYear;
private String mCoord;
public Tours(){}
public Tours(String id, String title, String year, String coord) {
this.mId = id;
this.mTitle = title;
this.mYear = year;
this.mCoord = coord;
}
public String getId() {return mId;}
public void setId(String id) {this.mId = id;}
public String getTitle() {return mTitle;}
public void setTitle(String title) {this.mTitle = title;}
public String getYear() {return mYear;}
public void setYear(String year) {this.mYear = year;}
public String getCoord() {return mCoord;}
public void setCoord(String coord) {this.mCoord = coord;}
}
答案 0 :(得分:0)
添加网络视图
Experiment ID
并编写此代码,您希望执行任务
Webview webView=(WebView)findViewById(R.id.webView1);
答案 1 :(得分:0)
在oncreateVew()
奶油刀初始化地点内添加
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup
container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.about_fragment, container,
false);
ButterKnife.bind(getActivity(), view);
return view;
}
@OnClick(R.id.bAbout)
public void someButtonOnClick(View view) {
String url = "http://www.example.com";
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);
}
答案 2 :(得分:0)
您在代码的某个位置收到 NullPointerException 。可能在这一行:Tours.java:84
但该代码不在你的帖子中..