我已经将android studio从3.0更新到3.0.1但是当我启动Emulator它没有启动并在事件日志中给出消息:
Emulator: Process finished with exit code 0
Run Code Online (Sandbox Code Playgroud) 我在两个android项目中遇到这个问题.在一个我试图从Firebase检索数据到Recyclerview和另一个我试图使用电话号码登录但在两种情况下logcat显示V/FA:
Inactivity, disconnecting from the service
Run Code Online (Sandbox Code Playgroud) 我有一个 recyclerview 并且我正在使用约束布局。现在我想使用高度作为wrap_content但想以百分比设置最大高度。我如何使用约束布局来实现这一点?
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:visibility="gone"
app:layout_constraintTop_toBottomOf="@+id/search_view"
android:layout_height="0dp"
app:layout_constraintHeight_default="wrap"
app:layout_constraintHeight_max="500dp"
android:scrollbars="vertical"/>
Run Code Online (Sandbox Code Playgroud) android android-layout android-recyclerview android-constraintlayout
应用程序在游戏控制台中显示此错误,并且报告了许多崩溃,但没有显示发生的时间点。我无法复制它。
android.app.RemoteServiceException:
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1785)
at android.os.Handler.dispatchMessage (Handler.java:106)
at android.os.Looper.loop (Looper.java:205)
at android.app.ActivityThread.main (ActivityThread.java:6991)
at java.lang.reflect.Method.invoke (Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:884)
Run Code Online (Sandbox Code Playgroud) 私钥未正确加密,或者不是我们支持的密钥类型。我在 Play 控制台上生成了 Play 签名密钥
$ java -jar pepk.jar --keystore=foo.keystore --alias=foo --output=encrypted_private_key_path --rsa-aes-encryption --encryption-key-path=/path/to/encryption_public_key.pem
Run Code Online (Sandbox Code Playgroud)
我使用上面的命令生成密钥后生成它给我错误
The private key was not properly encrypted, or is not a type of key we support while generating app signing key
Run Code Online (Sandbox Code Playgroud)
我希望从Firebase数据库获取数据时,活动必须显示“进度对话框”。它没有显示任何内容,并且崩溃了。这是我的下面的代码
公共类profilemain扩展了AppCompatActivity {
private FirebaseAuth mAuth;
private FirebaseAuth.AuthStateListener mAuthListener;
private ProgressDialog progressDialog;
DatabaseReference mref =
FirebaseDatabase.getInstance().getReference("users");
ListView mlistview;
ArrayList<String> arrayList=new ArrayList<>();
ArrayAdapter<String> arrayAdapter;
private BottomNavigationView.OnNavigationItemSelectedListener
mOnNavigationItemSelectedListener
= new BottomNavigationView.OnNavigationItemSelectedListener() {
@Override
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
switch (item.getItemId()) {
case R.id.navigation_home:
progressDialog.show();
startActivity(new
Intent(profilemain.this,profilemain.class));
return true;
case R.id.navigation_dashboard:
Toast.makeText(profilemain.this,"hi
hello",Toast.LENGTH_SHORT).show();
return true;
case R.id.navigation_notifications:
Toast.makeText(profilemain.this,"hi
hello",Toast.LENGTH_SHORT).show();
return true;
case R.id.navigation_signout:
Toast.makeText(profilemain.this,"You have successfully
Signed out",Toast.LENGTH_SHORT).show();
mAuth.signOut();
return true;
}
return false;
}
};
@Override
protected void onCreate(Bundle savedInstanceState) { …
Run Code Online (Sandbox Code Playgroud) 我在警报对话框中创建登录表单,但在此对话框中,我想在下面添加忘记密码链接登录,这将链接到另一个活动.我尝试了很多修改但它崩溃了.我在这个App.App中使用Firebase身份验证,当我修改主要活动中的代码并出错时.下面是我的主要java代码.
package com.techno.giants.technogiants;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.rengwuxian.materialedittext.MaterialEditText;
import com.techno.giants.technogiants.Model.User;
import uk.co.chrisjenx.calligraphy.CalligraphyConfig;
import uk.co.chrisjenx.calligraphy.CalligraphyContextWrapper;
public class MainActivity extends AppCompatActivity {
RelativeLayout rootLayout;
Button btnSignIn,btnRegister;
FirebaseAuth auth;
FirebaseAuth.AuthStateListener mAuthListener;
FirebaseDatabase db;
DatabaseReference users;
@Override
protected void attachBaseContext(Context newBase) {
super.attachBaseContext(CalligraphyContextWrapper.wrap(newBase));
}
@Override
protected void …
Run Code Online (Sandbox Code Playgroud) android android-alertdialog firebase firebase-authentication firebase-realtime-database
我正在我的应用程序中的单个 Activity 下集成 Google 登录和 Twitter 登录,但是当我点击 twitter 登录按钮时,它会授权帐户,然后推回 mainActivity,并出现下面提到的错误。Google 登录正常工作,但在授权后点击 twitter 登录按钮发送回主要活动。
Authorization completed with an error
com.twitter.sdk.android.core.TwitterAuthException: Authorize failed.
at com.twitter.sdk.android.core.identity.TwitterAuthClient.handleAuthorize(TwitterAuthClient.java:112)
at com.twitter.sdk.android.core.identity.TwitterAuthClient.authorize(TwitterAuthClient.java:103)
at com.twitter.sdk.android.core.identity.TwitterLoginButton$LoginClickListener.onClick(TwitterLoginButton.java:160)
at android.view.View.performClick(View.java:5106)
at android.view.View$PerformClick.run(View.java:20329)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5912)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(Zyg
Run Code Online (Sandbox Code Playgroud)
我的主要活动代码是
public class MainActivity extends AppCompatActivity {
SignInButton signInButton;
TwitterLoginButton mLoginButton;
ProgressDialog progressDialog;
GoogleSignInClient mGoogleSignInClient;
FirebaseAuth mAuth;
private static final String TAG = "GoogleActivity";
private static final String TAGS = "TwitterLogin";
private static final …
Run Code Online (Sandbox Code Playgroud) twitter android twitter-oauth firebase firebase-authentication
Android searchview 有默认的 queryhint textcolor 和 text color 。我们如何使用 AndroidX 更改 Android Searchview 中 edittext 的文本颜色
我用来<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
显示一个覆盖在其他应用程序上的弹出窗口,但 android 12 阻止了触摸。根据文档,它会阻止触摸事件,我如何允许在 android 12 上进行触摸。
这是 android 12 行为更改触摸事件的链接 https://developer.android.com/about/versions/12/behavior-changes-all#untrusted-touch-events
import android.app.Service;
import android.content.Intent;
import android.graphics.PixelFormat;
import android.hardware.input.InputManager;
import android.os.IBinder;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.WindowManager;
public class FloatWidgetService extends Service {
private WindowManager mWindowManager;
private View mFloatingWidget;
public FloatWidgetService() {
}
@Override
public IBinder onBind(Intent intent) {
return null;
}
@Override
public void onCreate() {
super.onCreate();
final WindowManager.LayoutParams params;
mFloatingWidget = LayoutInflater.from(this).inflate(R.layout.layout_floating_widget, null);
mFloatingWidget.setFilterTouchesWhenObscured(true);
params = new WindowManager.LayoutParams(
WindowManager.LayoutParams.WRAP_CONTENT, …
Run Code Online (Sandbox Code Playgroud) android ×10
firebase ×4
java ×2
android-12 ×1
androidx ×1
google-play ×1
kotlin ×1
logcat ×1
searchview ×1
twitter ×1