اذهب إلى المحتوى

Flutter Dev

الأعضاء
  • المساهمات

    787
  • تاريخ الانضمام

  • تاريخ آخر زيارة

  • عدد الأيام التي تصدر بها

    2

كل منشورات العضو Flutter Dev

  1. هلا بيك عزيزي نفس المشكلة السابقه Cannot resolve method 'getResources()'
  2. لما حاولت استخدم كودك بشكل التالي @Mohamd Imran public CharSequence getPageTitle(int position) { switch (position){ case 0: return "Students"; Resources res = getResources(); String text = res.getString(R.string.Tital); case 1:return "teacher"; default:return null; } يظهر لدي الخطاء التالي : Cannot resolve method 'getResources()'
  3. اهلا اخي ارغب ب استخدامه في هذا الموقع بتحديد getPageTitle(int position) { switch (position){ case 0:return "Students"; case 1:return "teacher"; default:return null; } } كيف يمكنني ذلك؟لني جربت كذا طريقه ولم تنجح لدي
  4. السلام عليكم ورحمة الله وبركاته اريد معرفة طريقة تغير اسم tablelyout من ملف string استدعيه الكود كالتالي public class FregmantPageAdapter extends FragmentPagerAdapter { public FregmantPageAdapter(@NonNull FragmentManager fm) { super(fm); } @NonNull @Override public Fragment getItem(int position) { if (position==0) return new Table1(); else return new table2(); } @Override public int getCount() { return 2; } @Nullable @Override public CharSequence getPageTitle(int position) { switch (position){ case 0:return "Students"; case 1:return "teacher"; default:return null; } } } بحيث اني استدعي كلمة الطلاب من ملف الاسترينج والأستاذ أيضا حاول ب طرق التي اعرفها ولم تنجح لدي كيف يمكن عمل ذلك بارك الله فيكم
  5. من يومين وانا احاول افهم ما قصدته اخوي الان فهمت لا اعلم لماذا ولكن المشكله التي ظهرت لديك ما تظهر لدي في هاتف اصدار انرويد 7 لذلك انا لم اعرف المشكلة ولكن الان وانا اجربه على هاتف مختلفة اصدار الاندرويد p واجهتني المشكلة كل الشكر لك اخوي ربي يعطيك الف عافيه
  6. @Mohamd Imran اهلا اخي لم افهم قصدك ب مسار null ولكن المشكلة ليست انه فارغ المشكلة ان لو قمت بعمل رابط للاكتفي a ورابط للاكتفي b الاثنين رح يتوجهو الى الاكتفتي a بعد الضغط عليهم وهذا الشي غلط بنسبه للاكتفتي b
  7. اهلا عزيزي عذرا على التاخر بس كنت اعمل نموذج للمشكلة حتى يسهل تشغيله تم ارفاق النموذج جرب اعمل لو تكرمت مشاركه من الاكتفتي بثنيهم وشاهد الفرق الذي يحدث الاثنين سوف يتم توجيهم نحو اكتفتي A MyApplication22.rar
  8. بتاكيد عزيزي دقائق فقط وسارفق المشروع كل الشكر لك ي غالي
  9. اصبح الكود كالتالي : <!-- 1--> <activity android:name=".Fragmantmarket.MainActivityFargmainMarket"> <intent-filter android:autoVerify="true"> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="http" android:host="marketoman.000webhostapp.com" android:pathPrefix="/post" /> </intent-filter> </activity> <activity android:name=".Fragmant.MainActivityFargmain"> <intent-filter android:autoVerify="true"> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="http" android:host="marketoman.000webhostapp.com" android:path="/posts" /> </intent-filter> </activity> ولكن بدون فائده الرابط لا يقرا الاكتفتي الثاني ابد وكانه ليس موجود بالاساس لا يزال يتوجه الى الاكتفتي الاول قمت بتجربة اشيا كثيره وبدون فائده
  10. شاهد اخي انا قمت بتعديل الكود حسب ما اخبرتني واختصره الى واحد data فقط اصبح الكود كامل كالتالي <!-- 1--> <activity android:name=".Fragmantmarket.MainActivityFargmainMarket"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="http" android:host="marketoman.000webhostapp.com" android:pathPrefix="/post" /> </intent-filter> </activity> <!-- 2 --> <activity android:name=".Fragmant.MainActivityFargmain"> <intent-filter android:autoVerify="true"> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="http" android:host="marketoman.000webhostapp.com" android:path="/posts" /> </intent-filter> </activity> هذا الكود الان لما اعمل مشاركة توجد نفس المشكلة فيه يروح الى اكتفتي واحد فقط الى هو الاكتفتي الاول وفي حالة مت بتعديل الملف الى الشكل التالي : فسيفتح لدي المتصفح (التغير في path) <!-- 1--> <activity android:name=".Fragmantmarket.MainActivityFargmainMarket"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="http" android:host="marketoman.000webhostapp.com" android:path="/post" /> </intent-filter> </activity> <!-- 2 --> <activity android:name=".Fragmant.MainActivityFargmain"> <intent-filter android:autoVerify="true"> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="http" android:host="marketoman.000webhostapp.com" android:path="/posts" /> </intent-filter> </activity> حسب ما فهمت الان اول كود ميه ميه ولكن مشكلته لا يتوجه الى الصفحة الثانية او الاكتفتي الثاني مع اني اعمل مشاركة من الاكتفتي الثاني @Mohamd Imran وهذا شكل الكود من الواتساب
  11. الان اصبح شكل الكود كالتالي عزيزي <!-- 1--> <activity android:name=".Fragmantmarket.MainActivityFargmainMarket"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="http" android:host="marketoman.000webhostapp.com" android:pathPrefix="/post" /> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="https" android:host="marketoman.000webhostapp.com" android:pathPrefix="/post" /> </intent-filter> </activity> <!-- 2 --> <activity android:name=".Fragmant.MainActivityFargmain"> <intent-filter android:autoVerify="true"> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="https" android:host="marketoman.000webhostapp.com" android:path="/posts" /> </intent-filter> </activity> ياخذني الى التطبيق ولكن مع نفس المشكلة الى الاكتفتي الاول وبنسبة لو قمت بعمل path بدل pathPrefix في الاكتفتي الاول فلن ياخذني الى التطبيق بل الى المتصفح
  12. نعم الرابط الذي اقوم بمشاركته كالتالي https://marketoman.000webhostapp.com/posts/134 ونوع الثاني يكون بدون اضافة ال s الى كلمة بوست
  13. عملت الكود بشكل التالي : <!-- 1--> <activity android:name=".Fragmantmarket.MainActivityFargmainMarket" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="http" android:host="marketoman.000webhostapp.com" android:path="/post" /> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="https" android:host="marketoman.000webhostapp.com" android:path="/post" /> </intent-filter> </activity> <!-- 2 --> <activity android:name=".Fragmant.MainActivityFargmain"> <intent-filter > <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="http" android:host="marketoman.000webhostapp.com" android:path="/posts" /> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="https" android:host="marketoman.000webhostapp.com" android:path="/posts" /> </intent-filter> </activity> الان كلما ضغطت على الرابط ياخذني الى المتصفح وليس التطبيق
  14. انا عامل واحد كذا اخي android:pathPrefix="/posts" وثاني كذا android:pathPrefix="/post" الكلمات مختلفات او كيف قصدك اعمل مسار مختلف؟
  15. هلا بيك عزيزي @Mohamd Imran قمت بحذف السطر التالي من الاكتفتي الثاني <category android:name="android.intent.category.DEFAULT" /> ونجح الامر الان فعلا يظهر لي تطبيق واحد فقط ولكن توجد مشكلة واحده الان الان مثلا انا عملت مشاركة من الاكتفتي الاول طبعا هو اكتفتي مختلف عن ثاني من ناحية التصميم وكل شي بعد دخول لينك من الاكتفتي الاول لو عملت مشاركة للاكتفتي الثاني رح يوديني لينك الى الاكتفتي الاول طبعا هذا الشي غلط لنه حتى القول مختلفة والبيانات لا تظهر بهذا الشكل المفترض يذهب بي الا الاكتفتي الثاني فما هو الحل عزيزي ؟
  16. اهلا اخي شكرا على ردك في البدايه لم تنجح الطريقة عزيزي للعلم المشكلة تحدث بعد اول تثبيت للتطبيق فقط ولو المستخدم اختار الاختيار الصحيح بعدها لا يظهر له السوال ولكن هذا خطاء المفترض من البدايه هو يشاهد خيار واحد فقط اشلون هو بيعرف هذا صح وهذا غلط
  17. السلام عليكم ورحمة الله وبركاته تحيه طيبه للجميع لدي استفسار ي اخوان لو تكرمتو الي معه خلفيه عن الامر انا استخدم deep linkin لمشاركة رابط الاكتفتي الى تطبيقات مختلفة مثل الواتساب المشكلة انني ارغب بمشاركة 2 من الاكتفتي مختلفين الان انا قادر على مشاركتهم ولكن لو افترضنا قمت بمشاركة activity A لما اضغط على رابط رح يظهر لي اختيار تطبيقي حسنا هذا جيد وسياخذني الى activity A ولكن الان لو عملت مشاركة الى activity B لما احاول اضغط على الرابط رح يظهر تطبيقي مرتين من ضمن التطبيقات ولو قمت باختيار ما سبق اختياره لدى activity A سوف ياخذني الى اكتفتي activity A فما هو الحل المتفرض لدى اختيار activity B يظهر لدي تطبيق واحد كما حدث لدى activity A وياخذني الى الاكتفتي المقصود الكود الذي استخدمه كالتالي : <!-- 1--> <activity android:name=".FragmanM.MainActivityM" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="http" android:host="============" android:pathPrefix="/post" /> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="https" android:host="===============" android:pathPrefix="/post" /> </intent-filter> </activity> <!-- 2 --> <activity android:name=".FragmantA.MainActivityA" > <intent-filter > <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="http" android:host="================" android:pathPrefix="/posts" /> </intent-filter> <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="https" android:host="===============" android:pathPrefix="/posts" /> </intent-filter> </activity> اكتفتي M Uri data =getActivity(). getIntent().getData(); if (data!= null) { try { post_id = data.getLastPathSegment().toString(); getPost(post_id); } catch (NumberFormatException e) { post_id=null; } } Bundle bundle = getActivity().getIntent().getExtras(); if (bundle !=null){ if(post_id==null){ post_id =bundle.getString("mid"); getPost(post_id); } } اكتفتي A Uri data =getActivity(). getIntent().getData(); if (data!= null) { try { posts_id = data.getLastPathSegment().toString(); getPost(posts_id); } catch (NumberFormatException e) { posts_id=null; } } Bundle bundle = getActivity().getIntent().getExtras(); if (bundle !=null){ if(posts_id==null){ posts_id =bundle.getString("moid"); getPost(posts_id); } } صورة توضيحية هذا لدى اختيار اول اكتفتي ما يظهر وهو صحيح طبعا وهذا ما يظهر في الرابط الثاني وهو خطاء طبعا يجب ان يشاهد المستخدم تطبيقي لمرة واحد وان يكون الاكتفتي المستهدف ياليت اذا احد يعرف الحل يساعدنا مشكور
  18. هلا بيك اخي قمت بتابع خطواتك + تغير المتصفح ونجح الامر يبدو ان الجوجل كروم يستعدي بيانات لوكل هوست
  19. السلام عليكم ورحمة الله وبركاته تحيه طيبه للجميع استفسار لو تكرمتو كيف يمكن عمل مشاركة للاكتفتي انا الان عامل مشاركة لصورة من الاكتفتي مثلا او نص واريد ارسل رابط للمستخدم لدى الصوره بحيث لو ضغط على الرابط رح يتوجه الى اكتفتي الصورة او المشاركة التي توجد بها الصوره التي تم مشاركتها مثال على الكود المستخدم الان: String text = "Look at my awesome picture"; Uri pictureUri = Uri.parse("file://my_picture"); Intent shareIntent = new Intent(); shareIntent.setAction(Intent.ACTION_SEND); shareIntent.putExtra(Intent.EXTRA_TEXT, text); shareIntent.putExtra(Intent.EXTRA_STREAM, imageUri); shareIntent.setType("image/*"); shareIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); startActivity(Intent.createChooser(shareIntent, "Share images...")); كيف يمكن التعديل عليه بحيث اصبح قادر على مشاركة رابط الاكتفتي الذي تم عمل مشاركة منه
  20. تم اخي دقائق فقط رح اعمل نسخه مصغره من المشروع وارفقها
  21. العذر وسموحه اخي تعبتك معي بنسبه ل اصدار نظام التشغيل هو 7.0 الذي اقوم بالاختبار عليه ليس جديد وبنسبه ل اضافة باكينج واتساب المشكلة تحدث بمجرد ان اضغط على زر المشاركة يعني شاشة اختيار التطبيقات التي سوف اشارك الصوره معها لا تظهر بالاساس الكرش يحدث قبل ذلك
  22. لا تزال المشكلة مستمره غريبه صراحه الامر الكود كامل الان كالتالي :مع العلم اني استخدم الكود في Fragment shareImage.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { shareImage(); } }); return rootView; } public void grantPermissions(Context context, Intent intent, Uri uri, boolean writeAble) { int flag = Intent.FLAG_GRANT_READ_URI_PERMISSION; if (writeAble) { flag |= Intent.FLAG_GRANT_WRITE_URI_PERMISSION; } intent.addFlags(flag); List<ResolveInfo> resInfoList = context.getPackageManager() .queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY); for (ResolveInfo resolveInfo : resInfoList) { String packageName = resolveInfo.activityInfo.packageName; context.grantUriPermission(packageName, uri, flag); } } private void shareImage( ) { BitmapDrawable bitmapDrawable = ((BitmapDrawable) prImg.getDrawable()); Bitmap myimg = bitmapDrawable .getBitmap(); String bitmapPath = MediaStore.Images.Media.insertImage(getActivity().getContentResolver(), myimg,"some title", null); Uri bitmapUri = Uri.parse(bitmapPath); Intent shareIntent=new Intent(Intent.ACTION_SEND); grantPermissions(getContext(),shareIntent,bitmapUri,true); shareIntent.setType("image/*"); shareIntent.putExtra(Intent.EXTRA_STREAM, bitmapUri); startActivity(Intent.createChooser(shareIntent,"Share Image")); }
  23. نفس المشكلة عزيزي الكراش كالتالي: 2020-07-02 00:31:48.100 26184-26184/com.example.myapplication E/MediaStore: Failed to insert image java.lang.SecurityException: Permission Denial: writing com.android.providers.media.MediaProvider uri content://media/external/images/media from pid=26184, uid=10315 requires android.permission.WRITE_EXTERNAL_STORAGE, or grantUriPermission() هذا شكل الكود كامل لدي الان : private void shareImage( ) { BitmapDrawable bitmapDrawable = ((BitmapDrawable) prImg.getDrawable()); Bitmap myimg = bitmapDrawable .getBitmap(); String bitmapPath = MediaStore.Images.Media.insertImage(getActivity().getContentResolver(), myimg,"some title", null); Uri bitmapUri = Uri.parse(bitmapPath); Intent shareIntent=new Intent(Intent.ACTION_SEND); shareIntent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); shareIntent.setType("image/*"); shareIntent.putExtra(Intent.EXTRA_STREAM, bitmapUri); startActivity(Intent.createChooser(shareIntent,"Share Image")); }
×
×
  • أضف...