我有一个 android 网络视图,它正确显示了网站,但是当我按下带有地理数据的链接时,我收到以下错误:“网站不可用,网站地理:48.9596430,9.125670?q=48.959630,9.125670 无法加载”
net::ERR_UNKNOWN_URL_SCHEME
当我在 chrome 浏览器上打开同一个网站时,它会用所需的坐标打开我的谷歌地图。
这是网络视图代码:
public class MainActivity extends Activity {
/**
* WebViewClient subclass loads all hyperlinks in the existing WebView
*/
public class GeoWebViewClient extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
// When user clicks a hyperlink, load in the existing WebView
view.loadUrl(url);
return true;
}
}
/**
* WebChromeClient subclass handles UI-related calls
* Note: think chrome as in decoration, not the Chrome browser
*/
public class GeoWebChromeClient extends …
Run Code Online (Sandbox Code Playgroud) 我正在尝试自定义 Android CalendarView,但我根本不知道该怎么做。例如,我想要的是,日历仅显示接下来的 7 天,如果您滑动接下来的 7 天等等......这可能吗?我认为通过设置 min 和 maxDate() 是可能的,但这是为整个日历设置的,你不能滑动......
我懂了:
import android.graphics.Color;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.CalendarView;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity {
CalendarView simpleCalendarView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
simpleCalendarView = (CalendarView) findViewById(R.id.simpleCalendarView); // get the reference of CalendarView
simpleCalendarView.setFocusedMonthDateColor(Color.RED); // set the red color for the dates of focused month
simpleCalendarView.setUnfocusedMonthDateColor(Color.BLUE); // set the yellow color for the dates of an unfocused month
simpleCalendarView.setSelectedWeekBackgroundColor(Color.RED); // red color for the selected …
Run Code Online (Sandbox Code Playgroud)