FATAL EXCEPTION:main
-1
Logcat:
2019-01-15 01:36:04.587 24940-24940/com.example.harshitgokharu.attendancemanager D/AndroidRuntime: Shutting down VM
2019-01-15 01:36:04.588 24940-24940/com.example.harshitgokharu.attendancemanager E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.harshitgokharu.attendancemanager, PID: 24940
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.harshitgokharu.attendancemanager/com.example.harshitgokharu.attendancemanager.MainActivity}: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.harshitgokharu.attendancemanager/com.example.harshitgokharu.attendancemanager.SecondActivity}; have you declared this activity in your AndroidManifest.xml?
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2646)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.harshitgokharu.attendancemanager/com.example.harshitgokharu.attendancemanager.SecondActivity}; have you declared this activity in your AndroidManifest.xml?
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1805)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1523)
at android.app.Activity.startActivityForResult(Activity.java:4224)
at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:767)
at android.app.Activity.startActivityForResult(Activity.java:4183)
at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:754)
at android.app.Activity.startActivity(Activity.java:4507)
at android.app.Activity.startActivity(Activity.java:4475)
at com.example.harshitgokharu.attendancemanager.MainActivity.onCreate(MainActivity.java:64)
at android.app.Activity.performCreate(Activity.java:6662)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2599)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
2019-01-15 01:36:04.845 1619-3731/system_process I/OpenGLRenderer: Initialized EGL, version 1.4
2019-01-15 01:36:04.845 1619-3731/system_process D/OpenGLRenderer: Swap behavior 1
2019-01-15 01:36:04.846 1619-3731/system_process W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
2019-01-15 01:36:04.846 1619-3731/system_process D/OpenGLRenderer: Swap behavior 0
2019-01-15 01:36:04.859 1619-3731/system_process D/EGL_emulation: eglCreateContext: 0x9ba8ac60: maj 2 min 0 rcv 2
2019-01-15 01:36:04.895 1619-3731/system_process D/EGL_emulation: eglMakeCurrent: 0x9ba8ac60: ver 2 0 (tinfo 0x8c6b8eb0)
2019-01-15 01:36:04.979 1619-3731/system_process D/EGL_emulation: eglMakeCurrent: 0x9ba8ac60: ver 2 0 (tinfo 0x8c6b8eb0)
2019-01-15 01:36:05.095 1619-1633/system_process W/ActivityManager: Activity pause timeout for ActivityRecord{156e97 u0 com.example.harshitgokharu.attendancemanager/.MainActivity t191 f}
2019-01-15 01:36:05.143 1619-1633/system_process I/WindowManager: Failed to capture screenshot of Token{9c4884 ActivityRecord{156e97 u0 com.example.harshitgokharu.attendancemanager/.MainActivity t191 f}} appWin=Window{c721825 u0 Starting com.example.harshitgokharu.attendancemanager} drawState=4
2019-01-15 01:36:05.254 1619-1695/system_process W/art: Long monitor contention with owner ActivityManager (1633) at void com.android.server.am.ActivityStack$ActivityStackHandler.handleMessage(android.os.Message)(ActivityStack.java:371) waiters=0 in void com.android.server.am.TaskPersister$LazyTaskWriterThread.run() for 157ms
2019-01-15 01:36:05.403 2107-2291/com.android.launcher3 D/EGL_emulation: eglMakeCurrent: 0x9bac3c80: ver 2 0 (tinfo 0x9d85df40)
2019-01-15 01:36:05.689 1619-1640/system_process I/WindowManager: Destroying surface Surface(name=Starting com.example.harshitgokharu.attendancemanager) called by com.android.server.wm.WindowStateAnimator.destroySurface:2016 com.android.server.wm.WindowStateAnimator.destroySurfaceLocked:882 com.android.server.wm.WindowState.removeLocked:1456 com.android.server.wm.WindowManagerService.removeWindowInnerLocked:2484 com.android.server.wm.AppWindowToken.destroySurfaces:365 com.android.server.wm.WindowStateAnimator.finishExit:565 com.android.server.wm.AppWindowAnimator.stepAnimationLocked:427 com.android.server.wm.WindowAnimator.updateAppWindowsLocked:176
2019-01-15 01:36:05.783 1619-1640/system_process W/WindowManager: Failed looking up window
java.lang.IllegalArgumentException: Requested window android.view.ViewRootImpl$W@a62241c does not exist
at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:9107)
at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:9098)
at com.android.server.wm.WindowManagerService.removeWindow(WindowManagerService.java:2302)
at com.android.server.wm.Session.remove(Session.java:202)
at android.view.ViewRootImpl.dispatchDetachedFromWindow(ViewRootImpl.java:3286)
at android.view.ViewRootImpl.doDie(ViewRootImpl.java:5881)
at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3622)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.os.HandlerThread.run(HandlerThread.java:61)
at com.android.server.ServiceThread.run(ServiceThread.java:46)
2019-01-15 01:36:05.804 2421-24429/com.google.android.gms I/Icing: Usage reports ok 125, Failed Usage reports 0, indexed 0, rejected 0, imm upload false
2019-01-15 01:36:05.836 2421-24429/com.google.android.gms I/Icing: Usage reports ok 0, Failed Usage reports 0, indexed 0, rejected 0, imm upload false
2019-01-15 01:36:05.854 2421-24429/com.google.android.gms I/Icing: Usage reports ok 0, Failed Usage reports 0, indexed 0, rejected 0, imm upload true
2019-01-15 01:36:05.872 12709-24923/com.google.android.googlequicksearchbox:search I/UpdateIcingCorporaServi: UpdateCorporaTask done [took 4087 ms] updated apps [took 4087 ms]
2019-01-15 01:36:05.928 2421-2806/com.google.android.gms I/Icing: IndexChimeraService.getServiceInterface callingPackage=com.google.android.gms componentName=AppsCorpus serviceId=36
2019-01-15 01:36:05.933 2421-2722/com.google.android.gms I/Icing: IndexChimeraService.getServiceInterface callingPackage=com.google.android.gms componentName=AppsCorpus serviceId=32
2019-01-15 01:36:05.968 2421-24945/com.google.android.gms I/Icing: Usage reports ok 0, Failed Usage reports 0, indexed 0, rejected 0, imm upload false
2019-01-15 01:36:05.997 2421-24945/com.google.android.gms I/Icing: Usage reports ok 0, Failed Usage reports 0, indexed 0, rejected 0, imm upload false
2019-01-15 01:36:06.918 2421-24945/com.google.android.gms I/Icing: Indexing com.google.android.gms-apps from com.google.android.gms
2019-01-15 01:36:07.011 2421-24945/com.google.android.gms I/Icing: Indexing done com.google.android.gms-apps
2019-01-15 01:36:07.017 2421-24945/com.google.android.gms I/Icing: Indexing com.google.android.googlequicksearchbox-applications_uri from com.google.android.googlequicksearchbox
2019-01-15 01:36:07.130 2421-24945/com.google.android.gms I/Icing: Indexing com.google.android.gms-internal.3p:MobileApplication from com.google.android.gms
2019-01-15 01:36:07.291 2421-24945/com.google.android.gms I/Icing: Indexing done com.google.android.googlequicksearchbox-applications_uri
2019-01-15 01:36:07.301 2421-24945/com.google.android.gms I/Icing: Indexing done com.google.android.gms-internal.3p:MobileApplication
2019-01-15 01:36:07.307 2421-24945/com.google.android.gms I/Icing: Indexing com.google.android.gms-apps from com.google.android.gms
2019-01-15 01:36:07.330 2421-24945/com.google.android.gms I/Icing: Indexing done com.google.android.gms-apps
2019-01-15 01:36:09.040 1619-2227/system_process I/ActivityManager: Killing 24492:com.google.android.talk/u0a53 (adj 906): empty #17
2019-01-15 01:36:09.091 1619-2289/system_process D/ActivityManager: cleanUpApplicationRecord -- 24492
2019-01-15 01:36:11.854 1619-2227/system_process I/ActivityManager: Killing 24531:com.google.android.talk:matchstick/u0a53 (adj 906): empty #17
2019-01-15 01:36:11.875 1619-1851/system_process D/ActivityManager: cleanUpApplicationRecord -- 24531
2019-01-15 01:36:15.573 1619-1633/system_process W/ActivityManager: Activity destroy timeout for ActivityRecord{156e97 u0 com.example.harshitgokharu.attendancemanager/.MainActivity t191 f}
2019-01-15 01:38:40.614 2049-2069/com.google.android.gms.persistent I/art: Background partial concurrent mark sweep GC freed 87854(4MB) AllocSpace objects, 0(0B) LOS objects, 25% free, 11MB/15MB, paused 2.998ms total 176.431ms
2019-01-15 01:40:24.827 1619-1674/system_process D/WifiNative-HAL: Failing getSupportedFeatureset because HAL isn't started
2019-01-15 01:40:24.832 1619-1636/system_process E/BluetoothAdapter: Bluetooth binder is null
2019-01-15 01:40:24.834 1619-1636/system_process E/BatteryStatsService: no controller energy info supplied
2019-01-15 01:40:24.846 1619-1636/system_process E/KernelCpuSpeedReader: Failed to read cpu-freq: /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state (No such file or directory)
2019-01-15 01:40:24.847 1619-1636/system_process E/KernelUidCpuTimeReader: Failed to read uid_cputime: /proc/uid_cputime/show_uid_stat (No such file or directory)
2019-01-15 01:40:24.853 1619-1636/system_process E/BatteryStatsService: modem info is invalid: ModemActivityInfo{ mTimestamp=0 mSleepTimeMs=0 mIdleTimeMs=0 mTxTimeMs=[0, 0, 0, 0, 0] mRxTimeMs=0 mEnergyUsed=0}
2019-01-15 01:41:04.614 1619-3175/system_process I/ActivityManager: Killing 24940:com.example.harshitgokharu.attendancemanager/u0a85 (adj 900): crash
2019-01-15 01:41:04.615 1619-3175/system_process D/ActivityManager: cleanUpApplicationRecord -- 24940
2019-01-15 01:41:04.647 1619-3731/system_process D/EGL_emulation: eglMakeCurrent: 0x9ba8ac60: ver 2 0 (tinfo 0x8c6b8eb0)
2019-01-15 01:41:04.666 1619-3407/system_process W/InputMethodManagerService: Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@a030199 attribute=null, token = android.os.BinderProxy@6cc6164
2019-01-15 01:41:04.896 1619-1640/system_process I/WindowManager: Destroying surface Surface(name=Application Error: com.example.harshitgokharu.attendancemanager) called by com.android.server.wm.WindowStateAnimator.destroySurface:2016 com.android.server.wm.WindowStateAnimator.destroySurfaceLocked:882 com.android.server.wm.WindowState.destroyOrSaveSurface:2100 com.android.server.wm.WindowSurfacePlacer.performSurfacePlacementInner:429 com.android.server.wm.WindowSurfacePlacer.performSurfacePlacementLoop:232 com.android.server.wm.WindowSurfacePlacer.performSurfacePlacement:180 com.android.server.wm.WindowManagerService$H.handleMessage:8086 android.os.Handler.dispatchMessage:102
2019-01-15 01:41:04.897 1619-1640/system_process W/AppOps: Finishing op nesting under-run: uid 1000 pkg android code 24 time=0 duration=0 nesting=0
Java File:
package com.example.harshitgokharu.attendancemanager;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.CardView;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
public class MainActivity extends AppCompatActivity {
EditText user;
EditText pass;
CardView card;
FirebaseAuth fire;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
user=(EditText)findViewById(R.id.user);
pass=(EditText)findViewById(R.id.pass);
card=(CardView)findViewById(R.id.card);
card.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(validate())
{
String user1= user.getText().toString();
String pass1= pass.getText().toString();
fire.signInWithEmailAndPassword(user1,pass1).addOnCompleteListener(new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if(task.isSuccessful())
{
Toast.makeText(MainActivity.this,"Login Successful",Toast.LENGTH_SHORT).show();
startActivity(new Intent(MainActivity.this,SecondActivity.class));
}
else
{
Toast.makeText(MainActivity.this,"Login Failed",Toast.LENGTH_SHORT).show();
}
}
});
};
}
});
fire=FirebaseAuth.getInstance();
FirebaseUser user=fire.getCurrentUser();
if(user!=null)
{
finish();
startActivity(new Intent(MainActivity.this,SecondActivity.class));
}
}
private Boolean validate()
{
Boolean result=false;
String user1= user.getText().toString();
String pass1= pass.getText().toString();
if(user1.isEmpty() || pass1.isEmpty()) {
Toast.makeText(this,"Please enter all the details",Toast.LENGTH_SHORT).show();
}
else
{
result=true;
}
return result;
}
}
XML file:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#E33441 "
tools:context=".MainActivity">
<ImageView
android:id="@+id/logo"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_marginBottom="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.492"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.203"
app:srcCompat="@drawable/logo"
android:contentDescription="@string/todo" />
<EditText
android:id="@+id/user"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_marginBottom="8dp"
android:autofillHints=""
android:background="#E33441 "
android:drawableStart="@drawable/ic_action_user"
android:drawableLeft="@drawable/ic_action_user"
android:ems="10"
android:hint="@string/user_id"
android:inputType="textPersonName"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:targetApi="o" />
<EditText
android:id="@+id/pass"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_marginBottom="8dp"
android:background="#E33441 "
android:drawableStart="@drawable/ic_action_lock"
android:drawableLeft="@drawable/ic_action_lock"
android:ems="10"
android:hint="@string/password"
android:importantForAutofill="no"
android:inputType="textPersonName"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.616"
tools:targetApi="o" />
<android.support.v7.widget.CardView
android:id="@+id/card"
android:layout_width="250dp"
android:layout_height="50dp"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="380dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
app:cardBackgroundColor="@color/colorPrimary"
app:cardCornerRadius="25dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/textView2"
android:layout_width="68dp"
android:layout_height="36dp"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="98dp"
android:layout_marginLeft="99dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="83dp"
android:layout_marginRight="99dp"
android:layout_marginBottom="8dp"
android:text="@string/login"
android:textColor="#fff"
android:textSize="25sp" />
</RelativeLayout>
</android.support.v7.widget.CardView>
</android.support.constraint.ConstraintLayout>
java android xml
New contributor
add a comment |
-1
Logcat:
2019-01-15 01:36:04.587 24940-24940/com.example.harshitgokharu.attendancemanager D/AndroidRuntime: Shutting down VM
2019-01-15 01:36:04.588 24940-24940/com.example.harshitgokharu.attendancemanager E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.harshitgokharu.attendancemanager, PID: 24940
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.harshitgokharu.attendancemanager/com.example.harshitgokharu.attendancemanager.MainActivity}: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.harshitgokharu.attendancemanager/com.example.harshitgokharu.attendancemanager.SecondActivity}; have you declared this activity in your AndroidManifest.xml?
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2646)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.harshitgokharu.attendancemanager/com.example.harshitgokharu.attendancemanager.SecondActivity}; have you declared this activity in your AndroidManifest.xml?
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1805)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1523)
at android.app.Activity.startActivityForResult(Activity.java:4224)
at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:767)
at android.app.Activity.startActivityForResult(Activity.java:4183)
at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:754)
at android.app.Activity.startActivity(Activity.java:4507)
at android.app.Activity.startActivity(Activity.java:4475)
at com.example.harshitgokharu.attendancemanager.MainActivity.onCreate(MainActivity.java:64)
at android.app.Activity.performCreate(Activity.java:6662)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2599)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
2019-01-15 01:36:04.845 1619-3731/system_process I/OpenGLRenderer: Initialized EGL, version 1.4
2019-01-15 01:36:04.845 1619-3731/system_process D/OpenGLRenderer: Swap behavior 1
2019-01-15 01:36:04.846 1619-3731/system_process W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
2019-01-15 01:36:04.846 1619-3731/system_process D/OpenGLRenderer: Swap behavior 0
2019-01-15 01:36:04.859 1619-3731/system_process D/EGL_emulation: eglCreateContext: 0x9ba8ac60: maj 2 min 0 rcv 2
2019-01-15 01:36:04.895 1619-3731/system_process D/EGL_emulation: eglMakeCurrent: 0x9ba8ac60: ver 2 0 (tinfo 0x8c6b8eb0)
2019-01-15 01:36:04.979 1619-3731/system_process D/EGL_emulation: eglMakeCurrent: 0x9ba8ac60: ver 2 0 (tinfo 0x8c6b8eb0)
2019-01-15 01:36:05.095 1619-1633/system_process W/ActivityManager: Activity pause timeout for ActivityRecord{156e97 u0 com.example.harshitgokharu.attendancemanager/.MainActivity t191 f}
2019-01-15 01:36:05.143 1619-1633/system_process I/WindowManager: Failed to capture screenshot of Token{9c4884 ActivityRecord{156e97 u0 com.example.harshitgokharu.attendancemanager/.MainActivity t191 f}} appWin=Window{c721825 u0 Starting com.example.harshitgokharu.attendancemanager} drawState=4
2019-01-15 01:36:05.254 1619-1695/system_process W/art: Long monitor contention with owner ActivityManager (1633) at void com.android.server.am.ActivityStack$ActivityStackHandler.handleMessage(android.os.Message)(ActivityStack.java:371) waiters=0 in void com.android.server.am.TaskPersister$LazyTaskWriterThread.run() for 157ms
2019-01-15 01:36:05.403 2107-2291/com.android.launcher3 D/EGL_emulation: eglMakeCurrent: 0x9bac3c80: ver 2 0 (tinfo 0x9d85df40)
2019-01-15 01:36:05.689 1619-1640/system_process I/WindowManager: Destroying surface Surface(name=Starting com.example.harshitgokharu.attendancemanager) called by com.android.server.wm.WindowStateAnimator.destroySurface:2016 com.android.server.wm.WindowStateAnimator.destroySurfaceLocked:882 com.android.server.wm.WindowState.removeLocked:1456 com.android.server.wm.WindowManagerService.removeWindowInnerLocked:2484 com.android.server.wm.AppWindowToken.destroySurfaces:365 com.android.server.wm.WindowStateAnimator.finishExit:565 com.android.server.wm.AppWindowAnimator.stepAnimationLocked:427 com.android.server.wm.WindowAnimator.updateAppWindowsLocked:176
2019-01-15 01:36:05.783 1619-1640/system_process W/WindowManager: Failed looking up window
java.lang.IllegalArgumentException: Requested window android.view.ViewRootImpl$W@a62241c does not exist
at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:9107)
at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:9098)
at com.android.server.wm.WindowManagerService.removeWindow(WindowManagerService.java:2302)
at com.android.server.wm.Session.remove(Session.java:202)
at android.view.ViewRootImpl.dispatchDetachedFromWindow(ViewRootImpl.java:3286)
at android.view.ViewRootImpl.doDie(ViewRootImpl.java:5881)
at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3622)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.os.HandlerThread.run(HandlerThread.java:61)
at com.android.server.ServiceThread.run(ServiceThread.java:46)
2019-01-15 01:36:05.804 2421-24429/com.google.android.gms I/Icing: Usage reports ok 125, Failed Usage reports 0, indexed 0, rejected 0, imm upload false
2019-01-15 01:36:05.836 2421-24429/com.google.android.gms I/Icing: Usage reports ok 0, Failed Usage reports 0, indexed 0, rejected 0, imm upload false
2019-01-15 01:36:05.854 2421-24429/com.google.android.gms I/Icing: Usage reports ok 0, Failed Usage reports 0, indexed 0, rejected 0, imm upload true
2019-01-15 01:36:05.872 12709-24923/com.google.android.googlequicksearchbox:search I/UpdateIcingCorporaServi: UpdateCorporaTask done [took 4087 ms] updated apps [took 4087 ms]
2019-01-15 01:36:05.928 2421-2806/com.google.android.gms I/Icing: IndexChimeraService.getServiceInterface callingPackage=com.google.android.gms componentName=AppsCorpus serviceId=36
2019-01-15 01:36:05.933 2421-2722/com.google.android.gms I/Icing: IndexChimeraService.getServiceInterface callingPackage=com.google.android.gms componentName=AppsCorpus serviceId=32
2019-01-15 01:36:05.968 2421-24945/com.google.android.gms I/Icing: Usage reports ok 0, Failed Usage reports 0, indexed 0, rejected 0, imm upload false
2019-01-15 01:36:05.997 2421-24945/com.google.android.gms I/Icing: Usage reports ok 0, Failed Usage reports 0, indexed 0, rejected 0, imm upload false
2019-01-15 01:36:06.918 2421-24945/com.google.android.gms I/Icing: Indexing com.google.android.gms-apps from com.google.android.gms
2019-01-15 01:36:07.011 2421-24945/com.google.android.gms I/Icing: Indexing done com.google.android.gms-apps
2019-01-15 01:36:07.017 2421-24945/com.google.android.gms I/Icing: Indexing com.google.android.googlequicksearchbox-applications_uri from com.google.android.googlequicksearchbox
2019-01-15 01:36:07.130 2421-24945/com.google.android.gms I/Icing: Indexing com.google.android.gms-internal.3p:MobileApplication from com.google.android.gms
2019-01-15 01:36:07.291 2421-24945/com.google.android.gms I/Icing: Indexing done com.google.android.googlequicksearchbox-applications_uri
2019-01-15 01:36:07.301 2421-24945/com.google.android.gms I/Icing: Indexing done com.google.android.gms-internal.3p:MobileApplication
2019-01-15 01:36:07.307 2421-24945/com.google.android.gms I/Icing: Indexing com.google.android.gms-apps from com.google.android.gms
2019-01-15 01:36:07.330 2421-24945/com.google.android.gms I/Icing: Indexing done com.google.android.gms-apps
2019-01-15 01:36:09.040 1619-2227/system_process I/ActivityManager: Killing 24492:com.google.android.talk/u0a53 (adj 906): empty #17
2019-01-15 01:36:09.091 1619-2289/system_process D/ActivityManager: cleanUpApplicationRecord -- 24492
2019-01-15 01:36:11.854 1619-2227/system_process I/ActivityManager: Killing 24531:com.google.android.talk:matchstick/u0a53 (adj 906): empty #17
2019-01-15 01:36:11.875 1619-1851/system_process D/ActivityManager: cleanUpApplicationRecord -- 24531
2019-01-15 01:36:15.573 1619-1633/system_process W/ActivityManager: Activity destroy timeout for ActivityRecord{156e97 u0 com.example.harshitgokharu.attendancemanager/.MainActivity t191 f}
2019-01-15 01:38:40.614 2049-2069/com.google.android.gms.persistent I/art: Background partial concurrent mark sweep GC freed 87854(4MB) AllocSpace objects, 0(0B) LOS objects, 25% free, 11MB/15MB, paused 2.998ms total 176.431ms
2019-01-15 01:40:24.827 1619-1674/system_process D/WifiNative-HAL: Failing getSupportedFeatureset because HAL isn't started
2019-01-15 01:40:24.832 1619-1636/system_process E/BluetoothAdapter: Bluetooth binder is null
2019-01-15 01:40:24.834 1619-1636/system_process E/BatteryStatsService: no controller energy info supplied
2019-01-15 01:40:24.846 1619-1636/system_process E/KernelCpuSpeedReader: Failed to read cpu-freq: /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state (No such file or directory)
2019-01-15 01:40:24.847 1619-1636/system_process E/KernelUidCpuTimeReader: Failed to read uid_cputime: /proc/uid_cputime/show_uid_stat (No such file or directory)
2019-01-15 01:40:24.853 1619-1636/system_process E/BatteryStatsService: modem info is invalid: ModemActivityInfo{ mTimestamp=0 mSleepTimeMs=0 mIdleTimeMs=0 mTxTimeMs=[0, 0, 0, 0, 0] mRxTimeMs=0 mEnergyUsed=0}
2019-01-15 01:41:04.614 1619-3175/system_process I/ActivityManager: Killing 24940:com.example.harshitgokharu.attendancemanager/u0a85 (adj 900): crash
2019-01-15 01:41:04.615 1619-3175/system_process D/ActivityManager: cleanUpApplicationRecord -- 24940
2019-01-15 01:41:04.647 1619-3731/system_process D/EGL_emulation: eglMakeCurrent: 0x9ba8ac60: ver 2 0 (tinfo 0x8c6b8eb0)
2019-01-15 01:41:04.666 1619-3407/system_process W/InputMethodManagerService: Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@a030199 attribute=null, token = android.os.BinderProxy@6cc6164
2019-01-15 01:41:04.896 1619-1640/system_process I/WindowManager: Destroying surface Surface(name=Application Error: com.example.harshitgokharu.attendancemanager) called by com.android.server.wm.WindowStateAnimator.destroySurface:2016 com.android.server.wm.WindowStateAnimator.destroySurfaceLocked:882 com.android.server.wm.WindowState.destroyOrSaveSurface:2100 com.android.server.wm.WindowSurfacePlacer.performSurfacePlacementInner:429 com.android.server.wm.WindowSurfacePlacer.performSurfacePlacementLoop:232 com.android.server.wm.WindowSurfacePlacer.performSurfacePlacement:180 com.android.server.wm.WindowManagerService$H.handleMessage:8086 android.os.Handler.dispatchMessage:102
2019-01-15 01:41:04.897 1619-1640/system_process W/AppOps: Finishing op nesting under-run: uid 1000 pkg android code 24 time=0 duration=0 nesting=0
Java File:
package com.example.harshitgokharu.attendancemanager;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.CardView;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
public class MainActivity extends AppCompatActivity {
EditText user;
EditText pass;
CardView card;
FirebaseAuth fire;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
user=(EditText)findViewById(R.id.user);
pass=(EditText)findViewById(R.id.pass);
card=(CardView)findViewById(R.id.card);
card.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(validate())
{
String user1= user.getText().toString();
String pass1= pass.getText().toString();
fire.signInWithEmailAndPassword(user1,pass1).addOnCompleteListener(new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if(task.isSuccessful())
{
Toast.makeText(MainActivity.this,"Login Successful",Toast.LENGTH_SHORT).show();
startActivity(new Intent(MainActivity.this,SecondActivity.class));
}
else
{
Toast.makeText(MainActivity.this,"Login Failed",Toast.LENGTH_SHORT).show();
}
}
});
};
}
});
fire=FirebaseAuth.getInstance();
FirebaseUser user=fire.getCurrentUser();
if(user!=null)
{
finish();
startActivity(new Intent(MainActivity.this,SecondActivity.class));
}
}
private Boolean validate()
{
Boolean result=false;
String user1= user.getText().toString();
String pass1= pass.getText().toString();
if(user1.isEmpty() || pass1.isEmpty()) {
Toast.makeText(this,"Please enter all the details",Toast.LENGTH_SHORT).show();
}
else
{
result=true;
}
return result;
}
}
XML file:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#E33441 "
tools:context=".MainActivity">
<ImageView
android:id="@+id/logo"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_marginBottom="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.492"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.203"
app:srcCompat="@drawable/logo"
android:contentDescription="@string/todo" />
<EditText
android:id="@+id/user"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_marginBottom="8dp"
android:autofillHints=""
android:background="#E33441 "
android:drawableStart="@drawable/ic_action_user"
android:drawableLeft="@drawable/ic_action_user"
android:ems="10"
android:hint="@string/user_id"
android:inputType="textPersonName"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:targetApi="o" />
<EditText
android:id="@+id/pass"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_marginBottom="8dp"
android:background="#E33441 "
android:drawableStart="@drawable/ic_action_lock"
android:drawableLeft="@drawable/ic_action_lock"
android:ems="10"
android:hint="@string/password"
android:importantForAutofill="no"
android:inputType="textPersonName"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.616"
tools:targetApi="o" />
<android.support.v7.widget.CardView
android:id="@+id/card"
android:layout_width="250dp"
android:layout_height="50dp"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="380dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
app:cardBackgroundColor="@color/colorPrimary"
app:cardCornerRadius="25dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/textView2"
android:layout_width="68dp"
android:layout_height="36dp"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="98dp"
android:layout_marginLeft="99dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="83dp"
android:layout_marginRight="99dp"
android:layout_marginBottom="8dp"
android:text="@string/login"
android:textColor="#fff"
android:textSize="25sp" />
</RelativeLayout>
</android.support.v7.widget.CardView>
</android.support.constraint.ConstraintLayout>
java android xml
New contributor
add a comment |
-1
-1
-1
Logcat:
2019-01-15 01:36:04.587 24940-24940/com.example.harshitgokharu.attendancemanager D/AndroidRuntime: Shutting down VM
2019-01-15 01:36:04.588 24940-24940/com.example.harshitgokharu.attendancemanager E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.harshitgokharu.attendancemanager, PID: 24940
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.harshitgokharu.attendancemanager/com.example.harshitgokharu.attendancemanager.MainActivity}: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.harshitgokharu.attendancemanager/com.example.harshitgokharu.attendancemanager.SecondActivity}; have you declared this activity in your AndroidManifest.xml?
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2646)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.harshitgokharu.attendancemanager/com.example.harshitgokharu.attendancemanager.SecondActivity}; have you declared this activity in your AndroidManifest.xml?
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1805)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1523)
at android.app.Activity.startActivityForResult(Activity.java:4224)
at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:767)
at android.app.Activity.startActivityForResult(Activity.java:4183)
at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:754)
at android.app.Activity.startActivity(Activity.java:4507)
at android.app.Activity.startActivity(Activity.java:4475)
at com.example.harshitgokharu.attendancemanager.MainActivity.onCreate(MainActivity.java:64)
at android.app.Activity.performCreate(Activity.java:6662)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2599)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
2019-01-15 01:36:04.845 1619-3731/system_process I/OpenGLRenderer: Initialized EGL, version 1.4
2019-01-15 01:36:04.845 1619-3731/system_process D/OpenGLRenderer: Swap behavior 1
2019-01-15 01:36:04.846 1619-3731/system_process W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
2019-01-15 01:36:04.846 1619-3731/system_process D/OpenGLRenderer: Swap behavior 0
2019-01-15 01:36:04.859 1619-3731/system_process D/EGL_emulation: eglCreateContext: 0x9ba8ac60: maj 2 min 0 rcv 2
2019-01-15 01:36:04.895 1619-3731/system_process D/EGL_emulation: eglMakeCurrent: 0x9ba8ac60: ver 2 0 (tinfo 0x8c6b8eb0)
2019-01-15 01:36:04.979 1619-3731/system_process D/EGL_emulation: eglMakeCurrent: 0x9ba8ac60: ver 2 0 (tinfo 0x8c6b8eb0)
2019-01-15 01:36:05.095 1619-1633/system_process W/ActivityManager: Activity pause timeout for ActivityRecord{156e97 u0 com.example.harshitgokharu.attendancemanager/.MainActivity t191 f}
2019-01-15 01:36:05.143 1619-1633/system_process I/WindowManager: Failed to capture screenshot of Token{9c4884 ActivityRecord{156e97 u0 com.example.harshitgokharu.attendancemanager/.MainActivity t191 f}} appWin=Window{c721825 u0 Starting com.example.harshitgokharu.attendancemanager} drawState=4
2019-01-15 01:36:05.254 1619-1695/system_process W/art: Long monitor contention with owner ActivityManager (1633) at void com.android.server.am.ActivityStack$ActivityStackHandler.handleMessage(android.os.Message)(ActivityStack.java:371) waiters=0 in void com.android.server.am.TaskPersister$LazyTaskWriterThread.run() for 157ms
2019-01-15 01:36:05.403 2107-2291/com.android.launcher3 D/EGL_emulation: eglMakeCurrent: 0x9bac3c80: ver 2 0 (tinfo 0x9d85df40)
2019-01-15 01:36:05.689 1619-1640/system_process I/WindowManager: Destroying surface Surface(name=Starting com.example.harshitgokharu.attendancemanager) called by com.android.server.wm.WindowStateAnimator.destroySurface:2016 com.android.server.wm.WindowStateAnimator.destroySurfaceLocked:882 com.android.server.wm.WindowState.removeLocked:1456 com.android.server.wm.WindowManagerService.removeWindowInnerLocked:2484 com.android.server.wm.AppWindowToken.destroySurfaces:365 com.android.server.wm.WindowStateAnimator.finishExit:565 com.android.server.wm.AppWindowAnimator.stepAnimationLocked:427 com.android.server.wm.WindowAnimator.updateAppWindowsLocked:176
2019-01-15 01:36:05.783 1619-1640/system_process W/WindowManager: Failed looking up window
java.lang.IllegalArgumentException: Requested window android.view.ViewRootImpl$W@a62241c does not exist
at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:9107)
at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:9098)
at com.android.server.wm.WindowManagerService.removeWindow(WindowManagerService.java:2302)
at com.android.server.wm.Session.remove(Session.java:202)
at android.view.ViewRootImpl.dispatchDetachedFromWindow(ViewRootImpl.java:3286)
at android.view.ViewRootImpl.doDie(ViewRootImpl.java:5881)
at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3622)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.os.HandlerThread.run(HandlerThread.java:61)
at com.android.server.ServiceThread.run(ServiceThread.java:46)
2019-01-15 01:36:05.804 2421-24429/com.google.android.gms I/Icing: Usage reports ok 125, Failed Usage reports 0, indexed 0, rejected 0, imm upload false
2019-01-15 01:36:05.836 2421-24429/com.google.android.gms I/Icing: Usage reports ok 0, Failed Usage reports 0, indexed 0, rejected 0, imm upload false
2019-01-15 01:36:05.854 2421-24429/com.google.android.gms I/Icing: Usage reports ok 0, Failed Usage reports 0, indexed 0, rejected 0, imm upload true
2019-01-15 01:36:05.872 12709-24923/com.google.android.googlequicksearchbox:search I/UpdateIcingCorporaServi: UpdateCorporaTask done [took 4087 ms] updated apps [took 4087 ms]
2019-01-15 01:36:05.928 2421-2806/com.google.android.gms I/Icing: IndexChimeraService.getServiceInterface callingPackage=com.google.android.gms componentName=AppsCorpus serviceId=36
2019-01-15 01:36:05.933 2421-2722/com.google.android.gms I/Icing: IndexChimeraService.getServiceInterface callingPackage=com.google.android.gms componentName=AppsCorpus serviceId=32
2019-01-15 01:36:05.968 2421-24945/com.google.android.gms I/Icing: Usage reports ok 0, Failed Usage reports 0, indexed 0, rejected 0, imm upload false
2019-01-15 01:36:05.997 2421-24945/com.google.android.gms I/Icing: Usage reports ok 0, Failed Usage reports 0, indexed 0, rejected 0, imm upload false
2019-01-15 01:36:06.918 2421-24945/com.google.android.gms I/Icing: Indexing com.google.android.gms-apps from com.google.android.gms
2019-01-15 01:36:07.011 2421-24945/com.google.android.gms I/Icing: Indexing done com.google.android.gms-apps
2019-01-15 01:36:07.017 2421-24945/com.google.android.gms I/Icing: Indexing com.google.android.googlequicksearchbox-applications_uri from com.google.android.googlequicksearchbox
2019-01-15 01:36:07.130 2421-24945/com.google.android.gms I/Icing: Indexing com.google.android.gms-internal.3p:MobileApplication from com.google.android.gms
2019-01-15 01:36:07.291 2421-24945/com.google.android.gms I/Icing: Indexing done com.google.android.googlequicksearchbox-applications_uri
2019-01-15 01:36:07.301 2421-24945/com.google.android.gms I/Icing: Indexing done com.google.android.gms-internal.3p:MobileApplication
2019-01-15 01:36:07.307 2421-24945/com.google.android.gms I/Icing: Indexing com.google.android.gms-apps from com.google.android.gms
2019-01-15 01:36:07.330 2421-24945/com.google.android.gms I/Icing: Indexing done com.google.android.gms-apps
2019-01-15 01:36:09.040 1619-2227/system_process I/ActivityManager: Killing 24492:com.google.android.talk/u0a53 (adj 906): empty #17
2019-01-15 01:36:09.091 1619-2289/system_process D/ActivityManager: cleanUpApplicationRecord -- 24492
2019-01-15 01:36:11.854 1619-2227/system_process I/ActivityManager: Killing 24531:com.google.android.talk:matchstick/u0a53 (adj 906): empty #17
2019-01-15 01:36:11.875 1619-1851/system_process D/ActivityManager: cleanUpApplicationRecord -- 24531
2019-01-15 01:36:15.573 1619-1633/system_process W/ActivityManager: Activity destroy timeout for ActivityRecord{156e97 u0 com.example.harshitgokharu.attendancemanager/.MainActivity t191 f}
2019-01-15 01:38:40.614 2049-2069/com.google.android.gms.persistent I/art: Background partial concurrent mark sweep GC freed 87854(4MB) AllocSpace objects, 0(0B) LOS objects, 25% free, 11MB/15MB, paused 2.998ms total 176.431ms
2019-01-15 01:40:24.827 1619-1674/system_process D/WifiNative-HAL: Failing getSupportedFeatureset because HAL isn't started
2019-01-15 01:40:24.832 1619-1636/system_process E/BluetoothAdapter: Bluetooth binder is null
2019-01-15 01:40:24.834 1619-1636/system_process E/BatteryStatsService: no controller energy info supplied
2019-01-15 01:40:24.846 1619-1636/system_process E/KernelCpuSpeedReader: Failed to read cpu-freq: /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state (No such file or directory)
2019-01-15 01:40:24.847 1619-1636/system_process E/KernelUidCpuTimeReader: Failed to read uid_cputime: /proc/uid_cputime/show_uid_stat (No such file or directory)
2019-01-15 01:40:24.853 1619-1636/system_process E/BatteryStatsService: modem info is invalid: ModemActivityInfo{ mTimestamp=0 mSleepTimeMs=0 mIdleTimeMs=0 mTxTimeMs=[0, 0, 0, 0, 0] mRxTimeMs=0 mEnergyUsed=0}
2019-01-15 01:41:04.614 1619-3175/system_process I/ActivityManager: Killing 24940:com.example.harshitgokharu.attendancemanager/u0a85 (adj 900): crash
2019-01-15 01:41:04.615 1619-3175/system_process D/ActivityManager: cleanUpApplicationRecord -- 24940
2019-01-15 01:41:04.647 1619-3731/system_process D/EGL_emulation: eglMakeCurrent: 0x9ba8ac60: ver 2 0 (tinfo 0x8c6b8eb0)
2019-01-15 01:41:04.666 1619-3407/system_process W/InputMethodManagerService: Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@a030199 attribute=null, token = android.os.BinderProxy@6cc6164
2019-01-15 01:41:04.896 1619-1640/system_process I/WindowManager: Destroying surface Surface(name=Application Error: com.example.harshitgokharu.attendancemanager) called by com.android.server.wm.WindowStateAnimator.destroySurface:2016 com.android.server.wm.WindowStateAnimator.destroySurfaceLocked:882 com.android.server.wm.WindowState.destroyOrSaveSurface:2100 com.android.server.wm.WindowSurfacePlacer.performSurfacePlacementInner:429 com.android.server.wm.WindowSurfacePlacer.performSurfacePlacementLoop:232 com.android.server.wm.WindowSurfacePlacer.performSurfacePlacement:180 com.android.server.wm.WindowManagerService$H.handleMessage:8086 android.os.Handler.dispatchMessage:102
2019-01-15 01:41:04.897 1619-1640/system_process W/AppOps: Finishing op nesting under-run: uid 1000 pkg android code 24 time=0 duration=0 nesting=0
Java File:
package com.example.harshitgokharu.attendancemanager;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.CardView;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
public class MainActivity extends AppCompatActivity {
EditText user;
EditText pass;
CardView card;
FirebaseAuth fire;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
user=(EditText)findViewById(R.id.user);
pass=(EditText)findViewById(R.id.pass);
card=(CardView)findViewById(R.id.card);
card.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(validate())
{
String user1= user.getText().toString();
String pass1= pass.getText().toString();
fire.signInWithEmailAndPassword(user1,pass1).addOnCompleteListener(new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if(task.isSuccessful())
{
Toast.makeText(MainActivity.this,"Login Successful",Toast.LENGTH_SHORT).show();
startActivity(new Intent(MainActivity.this,SecondActivity.class));
}
else
{
Toast.makeText(MainActivity.this,"Login Failed",Toast.LENGTH_SHORT).show();
}
}
});
};
}
});
fire=FirebaseAuth.getInstance();
FirebaseUser user=fire.getCurrentUser();
if(user!=null)
{
finish();
startActivity(new Intent(MainActivity.this,SecondActivity.class));
}
}
private Boolean validate()
{
Boolean result=false;
String user1= user.getText().toString();
String pass1= pass.getText().toString();
if(user1.isEmpty() || pass1.isEmpty()) {
Toast.makeText(this,"Please enter all the details",Toast.LENGTH_SHORT).show();
}
else
{
result=true;
}
return result;
}
}
XML file:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#E33441 "
tools:context=".MainActivity">
<ImageView
android:id="@+id/logo"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_marginBottom="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.492"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.203"
app:srcCompat="@drawable/logo"
android:contentDescription="@string/todo" />
<EditText
android:id="@+id/user"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_marginBottom="8dp"
android:autofillHints=""
android:background="#E33441 "
android:drawableStart="@drawable/ic_action_user"
android:drawableLeft="@drawable/ic_action_user"
android:ems="10"
android:hint="@string/user_id"
android:inputType="textPersonName"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:targetApi="o" />
<EditText
android:id="@+id/pass"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_marginBottom="8dp"
android:background="#E33441 "
android:drawableStart="@drawable/ic_action_lock"
android:drawableLeft="@drawable/ic_action_lock"
android:ems="10"
android:hint="@string/password"
android:importantForAutofill="no"
android:inputType="textPersonName"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.616"
tools:targetApi="o" />
<android.support.v7.widget.CardView
android:id="@+id/card"
android:layout_width="250dp"
android:layout_height="50dp"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="380dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
app:cardBackgroundColor="@color/colorPrimary"
app:cardCornerRadius="25dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/textView2"
android:layout_width="68dp"
android:layout_height="36dp"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="98dp"
android:layout_marginLeft="99dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="83dp"
android:layout_marginRight="99dp"
android:layout_marginBottom="8dp"
android:text="@string/login"
android:textColor="#fff"
android:textSize="25sp" />
</RelativeLayout>
</android.support.v7.widget.CardView>
</android.support.constraint.ConstraintLayout>
java android xml
New contributor
Logcat:
2019-01-15 01:36:04.587 24940-24940/com.example.harshitgokharu.attendancemanager D/AndroidRuntime: Shutting down VM
2019-01-15 01:36:04.588 24940-24940/com.example.harshitgokharu.attendancemanager E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.harshitgokharu.attendancemanager, PID: 24940
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.harshitgokharu.attendancemanager/com.example.harshitgokharu.attendancemanager.MainActivity}: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.harshitgokharu.attendancemanager/com.example.harshitgokharu.attendancemanager.SecondActivity}; have you declared this activity in your AndroidManifest.xml?
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2646)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.harshitgokharu.attendancemanager/com.example.harshitgokharu.attendancemanager.SecondActivity}; have you declared this activity in your AndroidManifest.xml?
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1805)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1523)
at android.app.Activity.startActivityForResult(Activity.java:4224)
at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:767)
at android.app.Activity.startActivityForResult(Activity.java:4183)
at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:754)
at android.app.Activity.startActivity(Activity.java:4507)
at android.app.Activity.startActivity(Activity.java:4475)
at com.example.harshitgokharu.attendancemanager.MainActivity.onCreate(MainActivity.java:64)
at android.app.Activity.performCreate(Activity.java:6662)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2599)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
2019-01-15 01:36:04.845 1619-3731/system_process I/OpenGLRenderer: Initialized EGL, version 1.4
2019-01-15 01:36:04.845 1619-3731/system_process D/OpenGLRenderer: Swap behavior 1
2019-01-15 01:36:04.846 1619-3731/system_process W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
2019-01-15 01:36:04.846 1619-3731/system_process D/OpenGLRenderer: Swap behavior 0
2019-01-15 01:36:04.859 1619-3731/system_process D/EGL_emulation: eglCreateContext: 0x9ba8ac60: maj 2 min 0 rcv 2
2019-01-15 01:36:04.895 1619-3731/system_process D/EGL_emulation: eglMakeCurrent: 0x9ba8ac60: ver 2 0 (tinfo 0x8c6b8eb0)
2019-01-15 01:36:04.979 1619-3731/system_process D/EGL_emulation: eglMakeCurrent: 0x9ba8ac60: ver 2 0 (tinfo 0x8c6b8eb0)
2019-01-15 01:36:05.095 1619-1633/system_process W/ActivityManager: Activity pause timeout for ActivityRecord{156e97 u0 com.example.harshitgokharu.attendancemanager/.MainActivity t191 f}
2019-01-15 01:36:05.143 1619-1633/system_process I/WindowManager: Failed to capture screenshot of Token{9c4884 ActivityRecord{156e97 u0 com.example.harshitgokharu.attendancemanager/.MainActivity t191 f}} appWin=Window{c721825 u0 Starting com.example.harshitgokharu.attendancemanager} drawState=4
2019-01-15 01:36:05.254 1619-1695/system_process W/art: Long monitor contention with owner ActivityManager (1633) at void com.android.server.am.ActivityStack$ActivityStackHandler.handleMessage(android.os.Message)(ActivityStack.java:371) waiters=0 in void com.android.server.am.TaskPersister$LazyTaskWriterThread.run() for 157ms
2019-01-15 01:36:05.403 2107-2291/com.android.launcher3 D/EGL_emulation: eglMakeCurrent: 0x9bac3c80: ver 2 0 (tinfo 0x9d85df40)
2019-01-15 01:36:05.689 1619-1640/system_process I/WindowManager: Destroying surface Surface(name=Starting com.example.harshitgokharu.attendancemanager) called by com.android.server.wm.WindowStateAnimator.destroySurface:2016 com.android.server.wm.WindowStateAnimator.destroySurfaceLocked:882 com.android.server.wm.WindowState.removeLocked:1456 com.android.server.wm.WindowManagerService.removeWindowInnerLocked:2484 com.android.server.wm.AppWindowToken.destroySurfaces:365 com.android.server.wm.WindowStateAnimator.finishExit:565 com.android.server.wm.AppWindowAnimator.stepAnimationLocked:427 com.android.server.wm.WindowAnimator.updateAppWindowsLocked:176
2019-01-15 01:36:05.783 1619-1640/system_process W/WindowManager: Failed looking up window
java.lang.IllegalArgumentException: Requested window android.view.ViewRootImpl$W@a62241c does not exist
at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:9107)
at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:9098)
at com.android.server.wm.WindowManagerService.removeWindow(WindowManagerService.java:2302)
at com.android.server.wm.Session.remove(Session.java:202)
at android.view.ViewRootImpl.dispatchDetachedFromWindow(ViewRootImpl.java:3286)
at android.view.ViewRootImpl.doDie(ViewRootImpl.java:5881)
at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3622)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.os.HandlerThread.run(HandlerThread.java:61)
at com.android.server.ServiceThread.run(ServiceThread.java:46)
2019-01-15 01:36:05.804 2421-24429/com.google.android.gms I/Icing: Usage reports ok 125, Failed Usage reports 0, indexed 0, rejected 0, imm upload false
2019-01-15 01:36:05.836 2421-24429/com.google.android.gms I/Icing: Usage reports ok 0, Failed Usage reports 0, indexed 0, rejected 0, imm upload false
2019-01-15 01:36:05.854 2421-24429/com.google.android.gms I/Icing: Usage reports ok 0, Failed Usage reports 0, indexed 0, rejected 0, imm upload true
2019-01-15 01:36:05.872 12709-24923/com.google.android.googlequicksearchbox:search I/UpdateIcingCorporaServi: UpdateCorporaTask done [took 4087 ms] updated apps [took 4087 ms]
2019-01-15 01:36:05.928 2421-2806/com.google.android.gms I/Icing: IndexChimeraService.getServiceInterface callingPackage=com.google.android.gms componentName=AppsCorpus serviceId=36
2019-01-15 01:36:05.933 2421-2722/com.google.android.gms I/Icing: IndexChimeraService.getServiceInterface callingPackage=com.google.android.gms componentName=AppsCorpus serviceId=32
2019-01-15 01:36:05.968 2421-24945/com.google.android.gms I/Icing: Usage reports ok 0, Failed Usage reports 0, indexed 0, rejected 0, imm upload false
2019-01-15 01:36:05.997 2421-24945/com.google.android.gms I/Icing: Usage reports ok 0, Failed Usage reports 0, indexed 0, rejected 0, imm upload false
2019-01-15 01:36:06.918 2421-24945/com.google.android.gms I/Icing: Indexing com.google.android.gms-apps from com.google.android.gms
2019-01-15 01:36:07.011 2421-24945/com.google.android.gms I/Icing: Indexing done com.google.android.gms-apps
2019-01-15 01:36:07.017 2421-24945/com.google.android.gms I/Icing: Indexing com.google.android.googlequicksearchbox-applications_uri from com.google.android.googlequicksearchbox
2019-01-15 01:36:07.130 2421-24945/com.google.android.gms I/Icing: Indexing com.google.android.gms-internal.3p:MobileApplication from com.google.android.gms
2019-01-15 01:36:07.291 2421-24945/com.google.android.gms I/Icing: Indexing done com.google.android.googlequicksearchbox-applications_uri
2019-01-15 01:36:07.301 2421-24945/com.google.android.gms I/Icing: Indexing done com.google.android.gms-internal.3p:MobileApplication
2019-01-15 01:36:07.307 2421-24945/com.google.android.gms I/Icing: Indexing com.google.android.gms-apps from com.google.android.gms
2019-01-15 01:36:07.330 2421-24945/com.google.android.gms I/Icing: Indexing done com.google.android.gms-apps
2019-01-15 01:36:09.040 1619-2227/system_process I/ActivityManager: Killing 24492:com.google.android.talk/u0a53 (adj 906): empty #17
2019-01-15 01:36:09.091 1619-2289/system_process D/ActivityManager: cleanUpApplicationRecord -- 24492
2019-01-15 01:36:11.854 1619-2227/system_process I/ActivityManager: Killing 24531:com.google.android.talk:matchstick/u0a53 (adj 906): empty #17
2019-01-15 01:36:11.875 1619-1851/system_process D/ActivityManager: cleanUpApplicationRecord -- 24531
2019-01-15 01:36:15.573 1619-1633/system_process W/ActivityManager: Activity destroy timeout for ActivityRecord{156e97 u0 com.example.harshitgokharu.attendancemanager/.MainActivity t191 f}
2019-01-15 01:38:40.614 2049-2069/com.google.android.gms.persistent I/art: Background partial concurrent mark sweep GC freed 87854(4MB) AllocSpace objects, 0(0B) LOS objects, 25% free, 11MB/15MB, paused 2.998ms total 176.431ms
2019-01-15 01:40:24.827 1619-1674/system_process D/WifiNative-HAL: Failing getSupportedFeatureset because HAL isn't started
2019-01-15 01:40:24.832 1619-1636/system_process E/BluetoothAdapter: Bluetooth binder is null
2019-01-15 01:40:24.834 1619-1636/system_process E/BatteryStatsService: no controller energy info supplied
2019-01-15 01:40:24.846 1619-1636/system_process E/KernelCpuSpeedReader: Failed to read cpu-freq: /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state (No such file or directory)
2019-01-15 01:40:24.847 1619-1636/system_process E/KernelUidCpuTimeReader: Failed to read uid_cputime: /proc/uid_cputime/show_uid_stat (No such file or directory)
2019-01-15 01:40:24.853 1619-1636/system_process E/BatteryStatsService: modem info is invalid: ModemActivityInfo{ mTimestamp=0 mSleepTimeMs=0 mIdleTimeMs=0 mTxTimeMs=[0, 0, 0, 0, 0] mRxTimeMs=0 mEnergyUsed=0}
2019-01-15 01:41:04.614 1619-3175/system_process I/ActivityManager: Killing 24940:com.example.harshitgokharu.attendancemanager/u0a85 (adj 900): crash
2019-01-15 01:41:04.615 1619-3175/system_process D/ActivityManager: cleanUpApplicationRecord -- 24940
2019-01-15 01:41:04.647 1619-3731/system_process D/EGL_emulation: eglMakeCurrent: 0x9ba8ac60: ver 2 0 (tinfo 0x8c6b8eb0)
2019-01-15 01:41:04.666 1619-3407/system_process W/InputMethodManagerService: Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@a030199 attribute=null, token = android.os.BinderProxy@6cc6164
2019-01-15 01:41:04.896 1619-1640/system_process I/WindowManager: Destroying surface Surface(name=Application Error: com.example.harshitgokharu.attendancemanager) called by com.android.server.wm.WindowStateAnimator.destroySurface:2016 com.android.server.wm.WindowStateAnimator.destroySurfaceLocked:882 com.android.server.wm.WindowState.destroyOrSaveSurface:2100 com.android.server.wm.WindowSurfacePlacer.performSurfacePlacementInner:429 com.android.server.wm.WindowSurfacePlacer.performSurfacePlacementLoop:232 com.android.server.wm.WindowSurfacePlacer.performSurfacePlacement:180 com.android.server.wm.WindowManagerService$H.handleMessage:8086 android.os.Handler.dispatchMessage:102
2019-01-15 01:41:04.897 1619-1640/system_process W/AppOps: Finishing op nesting under-run: uid 1000 pkg android code 24 time=0 duration=0 nesting=0
Java File:
package com.example.harshitgokharu.attendancemanager;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.CardView;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
public class MainActivity extends AppCompatActivity {
EditText user;
EditText pass;
CardView card;
FirebaseAuth fire;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
user=(EditText)findViewById(R.id.user);
pass=(EditText)findViewById(R.id.pass);
card=(CardView)findViewById(R.id.card);
card.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(validate())
{
String user1= user.getText().toString();
String pass1= pass.getText().toString();
fire.signInWithEmailAndPassword(user1,pass1).addOnCompleteListener(new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if(task.isSuccessful())
{
Toast.makeText(MainActivity.this,"Login Successful",Toast.LENGTH_SHORT).show();
startActivity(new Intent(MainActivity.this,SecondActivity.class));
}
else
{
Toast.makeText(MainActivity.this,"Login Failed",Toast.LENGTH_SHORT).show();
}
}
});
};
}
});
fire=FirebaseAuth.getInstance();
FirebaseUser user=fire.getCurrentUser();
if(user!=null)
{
finish();
startActivity(new Intent(MainActivity.this,SecondActivity.class));
}
}
private Boolean validate()
{
Boolean result=false;
String user1= user.getText().toString();
String pass1= pass.getText().toString();
if(user1.isEmpty() || pass1.isEmpty()) {
Toast.makeText(this,"Please enter all the details",Toast.LENGTH_SHORT).show();
}
else
{
result=true;
}
return result;
}
}
XML file:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#E33441 "
tools:context=".MainActivity">
<ImageView
android:id="@+id/logo"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_marginBottom="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.492"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.203"
app:srcCompat="@drawable/logo"
android:contentDescription="@string/todo" />
<EditText
android:id="@+id/user"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_marginBottom="8dp"
android:autofillHints=""
android:background="#E33441 "
android:drawableStart="@drawable/ic_action_user"
android:drawableLeft="@drawable/ic_action_user"
android:ems="10"
android:hint="@string/user_id"
android:inputType="textPersonName"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:targetApi="o" />
<EditText
android:id="@+id/pass"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_marginBottom="8dp"
android:background="#E33441 "
android:drawableStart="@drawable/ic_action_lock"
android:drawableLeft="@drawable/ic_action_lock"
android:ems="10"
android:hint="@string/password"
android:importantForAutofill="no"
android:inputType="textPersonName"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.616"
tools:targetApi="o" />
<android.support.v7.widget.CardView
android:id="@+id/card"
android:layout_width="250dp"
android:layout_height="50dp"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="380dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
app:cardBackgroundColor="@color/colorPrimary"
app:cardCornerRadius="25dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/textView2"
android:layout_width="68dp"
android:layout_height="36dp"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="98dp"
android:layout_marginLeft="99dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="83dp"
android:layout_marginRight="99dp"
android:layout_marginBottom="8dp"
android:text="@string/login"
android:textColor="#fff"
android:textSize="25sp" />
</RelativeLayout>
</android.support.v7.widget.CardView>
</android.support.constraint.ConstraintLayout>
java android xml
java android xml
New contributor
New contributor
New contributor
asked 9 hours ago
user41375user41375
1
1
New contributor
New contributor
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
user41375 is a new contributor. Be nice, and check out our Code of Conduct.
draft saved
draft discarded
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1109729%2ffatal-exceptionmain%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
user41375 is a new contributor. Be nice, and check out our Code of Conduct.
draft saved
draft discarded
user41375 is a new contributor. Be nice, and check out our Code of Conduct.
user41375 is a new contributor. Be nice, and check out our Code of Conduct.
user41375 is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
draft saved
draft discarded
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1109729%2ffatal-exceptionmain%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown