آموزش های این وب سایت به صورت رایگان در دسترس است. اطلاعات بیشتر
بروز خطا
   [message]
اشتراک در سوال
رای ها
[dataList]

کند و لگ دار بودن برنامه

شکیب  8 سال پیش  8 سال پیش
0 0

سلام دوستان وقتتون بخیر
من یه برنامه نوشتم ولی مشکلش اینه که کنده و روان کار نمیکنه مثلا NavigationBar رو که باز میکنم کند باز میشه یا رو ادیت تکست میزنم کیبورد کند میاد بالا و کند حرف ها رو نوشته میشن تو ادیت تکست
اول گفتم شاید مشکل از اینه که کد شلوغه سر یه برنامه جدید درست کردم و کد های قبلی رو کپی کردم ولی خیلی تمیز تر ولی باز هم برنامه کنده و اینکه تمام اکتویتی ها کند هستن ینی مثلا صفحه ی splash-screen برنامه فقط یک progressbar داره که همون progressbar هم کند میچرخه
ممنون میشم راهنماییم کنید :)

0 0
احتمالات زیادی وجود دارد کد خود رو قرار دهید در ضمن بگید با چی برنامه رو تست میکنید و اینکه مشخصات سیستم شما چیست (8 سال پیش)
0 0
کد که خیلی زیاده ولی قسمت نویگیشن بارش اینه : 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); } @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 onCreateOptionsMenu(Menu menu) { لینک Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { لینک Handle action bar item clicks here. The action bar will لینک automatically handle clicks on the Home/Up button, so long لینک as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); لینک SimplifiableIfStatement return super.onOptionsItemSelected(item); } @SuppressWarnings("StatementWithEmptyBody") @Override public boolean onNavigationItemSelected(MenuItem item) { لینک Handle navigation view item clicks here. int id = item.getItemId(); if (id == R.id.nav_camera) { Intent intent = new Intent(MainActivity.this, MapsActivity.class); current_date = etdate.getText().toString(); MainActivity.AsyncT2 asyncT2 = new MainActivity.AsyncT2(); asyncT2.execute(); new GetContacts2().execute(); } else if (id == R.id.nav_gallery) { AsyncT3 asyncT = new AsyncT3(); asyncT.execute(); Intent intent = new Intent(MainActivity.this, MyReserves.class); startActivity(intent); } else if (id == R.id.nav_manage) { Intent intent = new Intent(MainActivity.this, Setting.class); startActivity(intent); } else if (id == R.id.nav_profile) { Intent intent = new Intent(MainActivity.this, Profile.class); startActivity(intent); } else if (id == R.id.nav_send) { Intent intent = new Intent(MainActivity.this, Support.class); startActivity(intent); } else if (id == R.id.nav_logout) { Intent intent = new Intent(MainActivity.this, Login.class); startActivity(intent); finish(); } DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); drawer.closeDrawer(GravityCompat.START); return true; } کلا برنامه کنده حالا و فقط روی سیستم من کند نیست مثلا روی گوشی های مختلف هم که تست گرفتم کند اجرا میشه (8 سال پیش)
0 0
دوست عزیز کدتون رو به صورت خوانا قرار بدید و از تگ کد برای اون استفاده کنید اینجوری بهتر دیده میشه و دوستان میتونن نظر بدن (8 سال پیش)
 برای این سوال پاسخی وجود ندارد.

پاسخگویی و مشاهده پاسخ های این سوال تنها برای اعضای ویژه سایت امکان پذیر است .
چنانچه تمایل دارید به همه بخش ها دسترسی داشته باشید میتوانید از این بخش لایسنس این آموزش را خریداری نمایید .