我们知道,当应用程序做一些漫长的过程,比如从互联网上下载一些信息时,它可能会在加载应用程序之前显示启动画面,当应用程序完全加载时,它将显示主页面.在启动画面活动中,我们必须在线程中加载长进程,以避免在加载应用程序之前显示黑屏.我做了所有这些.但在显示应用程序之前还会出现黑屏.这是启动画面活动的onCreate方法:
protected override void OnCreate (Bundle bundle)
{
try {
base.OnCreate (bundle);
//_dt = DateTime.Now.AddSeconds (_splashTime);
SetContentView (Resource.Layout.Splash );
FirstLoadPB= FindViewById <ProgressBar >(Resource .Id.FirstLoadPB );
FirstLoadingInfo= FindViewById <TextView >(Resource .Id.FirstLoadInfo );
LoadApplication ();
} catch (System.Exception ex) {
Common.HandleException (ex);
}
}
Run Code Online (Sandbox Code Playgroud)
这是LoadApplication方法的代码:
public void LoadApplication()
{
new System.Threading.Thread (new ThreadStart (() =>
{
//Some Codes to load applications- Downloading from web and accessing the storage(Because was many codes - about 100 line- i was clear them.
} …Run Code Online (Sandbox Code Playgroud) 在Android Studio中使用新的(Firebase)助手添加新服务时,我收到此错误:
火力地堡
由于以下原因,没有客户能够添加到您的Firebase项目中:具有此软件包名称和SHA1的应用已连接到Google项目.如果您之前使用过Google API,请在"连接到现有项目"列表中选择该项目.
在Firebase控制台页面上,我选择了该选项IMPORT GOOGLE PROJECTS,然后继续集成Firebase服务.但是,当我尝试使用Android Studio Firebase助手添加更多服务时,我收到上述错误.
而我"in the Connect to an existing Project list"在任何地方都找不到这个?
当我对布局资源文件进行更改时,当从Android Studio 2.0(预览3b)构建并安装apk文件时,它不会更新/反映.
示例:我有一个EditText,我添加了TextInputLayout这样的:
<android.support.design.widget.TextInputLayout
android:id="@+id/input_layout_new_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp">
<EditText
android:id="@+id/edit_text_new_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/hint_your_new_password"
android:inputType="textPassword"
android:saveEnabled="false" />
</android.support.design.widget.TextInputLayout>
Run Code Online (Sandbox Code Playgroud)
更新应用程序后的结果与我添加之前的结果相同TextInputLayout,只是EditText没有TextInputLayout.
我尝试过的:
我怀疑这可能是预览3b版本的Android Studio 2.0导致此问题的一个错误.有任何想法吗?也许它只是一个设置/配置?
我想在 iOS 13+ 中使用DeviceMotion和DeviceOrientation事件WKWebView。我正在使用下面的代码
<html>
<style>
#container{
margin: 20px;
padding: 20px
}
#deviceType{
text-align: center;
font-family: Arial, Helvetica, sans-serif;
font-size: 3rem;
font-weight: bold;
color: #08f
}
#permission{
padding: 2rem 5rem;
background: #08f;
color: white;
margin-top: 30;
font-family: Arial, Helvetica, sans-serif;
font-size: 3rem;
border: none;
border-radius: 1rem
}
#permissionStatus{
text-align: center;
font-family: Arial, Helvetica, sans-serif;
font-size: 2.5rem;
font-weight: 600;
color: red;
margin-top: 30px
}
</style>
<body>
<div id="container">
<div id="deviceType"></div>
<div style="text-align: center">
<button id="permission">Ask …Run Code Online (Sandbox Code Playgroud)