我在我的应用程序中添加了一个登录名。现在,我的起始活动是LoginActivity。每当我填写我的帐户凭据以进入该应用程序时,我都会在我单击登录按钮时崩溃。这是我的错误日志:
01-13 15:49:23.752 3116-3408/? E/InputReader: QEEXO fs_classify_touch NULL, not calling FingerSense
01-13 15:49:23.887 3116-3408/? E/InputReader: QEEXO fs_touch_up NULL, not calling FingerSense
01-13 15:49:23.923 2475-2475/? E/HAL: load: id=gralloc != hmi->id=gralloc
01-13 15:49:23.938 3116-3130/? E/ReportTools: This is not beta user build
01-13 15:49:23.969 3116-3407/? E/InputDispatcher: channel '2f67413 com.example.hartl.main_pp/com.example.hartl.main_pp.LoginActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
01-13 15:49:23.974 3116-3126/? E/HsmCoreServiceImpl: onTransact in code is: 102
01-13 15:49:24.005 4043-4187/? E/HwLauncher: SettingsEx , no such field.
01-13 15:49:24.018 18188-18208/? E/TotemWeather: WidgetUtils getWidgetShowCityInfo return myLocation
01-13 15:49:24.073 2475-2475/? E/HAL: load: id=gralloc != hmi->id=gralloc
01-13 15:49:24.123 2475-2475/? E/HAL: load: id=gralloc != hmi->id=gralloc
01-13 15:49:24.262 2475-2475/? E/hwcomposer: setGpuBoost:228: Can't open /sys/class/devfreq/gpufreq/max_freq: Permission denied
01-13 15:49:24.605 2475-2475/? E/HAL: load: id=gralloc != hmi->id=gralloc
有人知道解决方案吗?谢谢
这是我的MainActivity
公共类MainActivity扩展了AppCompatActivity,实现了NavigationView.OnNavigationItemSelectedListener,OnMapReadyCallback {private TextView txtName; 私人TextView txtEmail; 私人Button btnLogout;
private SQLiteHandler db;
private SessionManager session;
private GoogleMap googleMap;
SupportMapFragment sMapfragment;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
txtName = (TextView) findViewById(R.id.name);
txtEmail = (TextView) findViewById(R.id.email);
// SqLite database handler
db = new SQLiteHandler(getApplicationContext());
// session manager
session = new SessionManager(getApplicationContext());
// Fetching user details from sqlite
HashMap<String, String> user = db.getUserDetails();
String name = user.get("name");
String email = user.get("email");
// Displaying the user details on the screen
txtName.setText(name);
txtEmail.setText(email);
// Logout button click event
sMapfragment = SupportMapFragment.newInstance();
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
drawer.setDrawerListener(toggle);
toggle.syncState();
NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
navigationView.setNavigationItemSelectedListener(this);
sMapfragment.getMapAsync(this);
if (ContextCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
if (ActivityCompat.shouldShowRequestPermissionRationale((Activity) this, android.Manifest.permission.ACCESS_FINE_LOCATION)) {
AlertDialog.Builder alertBuilder = new AlertDialog.Builder(this);
alertBuilder.setCancelable(false);
alertBuilder.setTitle("Permission necessary");
alertBuilder.setMessage("Fine Location is necessary");
alertBuilder.setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
public void onClick(DialogInterface dialog, int which) {
ActivityCompat.requestPermissions(MainActivity.this, new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION}, 1234);
}
});
AlertDialog alert = alertBuilder.create();
alert.show();
} else {
ActivityCompat.requestPermissions(MainActivity.this, new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION}, 1234);
}
}
}
@Override
public void onBackPressed() {
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
if (drawer.isDrawerOpen(GravityCompat.START)) {
drawer.closeDrawer(GravityCompat.START);
} else {
super.onBackPressed();
}
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
return super.onOptionsItemSelected(item);
}
@SuppressWarnings("StatementWithEmptyBody")
@Override
public boolean onNavigationItemSelected(MenuItem item) {
android.support.v4.app.FragmentManager sFm = getSupportFragmentManager();
int id = item.getItemId();
if (sMapfragment.isAdded())
sFm.beginTransaction().hide(sMapfragment).commit();
if (id == R.id.nav_map) {
if (!sMapfragment.isAdded())
sFm.beginTransaction().add(R.id.penats, sMapfragment).commit();
else
sFm.beginTransaction().show(sMapfragment).commit();
} else if (id == R.id.nav_locations) {
} else if (id == R.id.nav_events) {
} else if (id == R.id.nav_calendar) {
} else if (id == R.id.nav_chat) {
} else if (id == R.id.nav_ranking) {
}
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
drawer.closeDrawer(GravityCompat.START);
return true;
}
@SuppressWarnings("ResourceType")
@Override
public void onMapReady(GoogleMap googleMap) {
googleMap.setMyLocationEnabled(true);
}
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句