[Solved] How to create GUI in android [closed]

What else is in the GUI please show the complete GUI pic or the code you have tried You can use a textView add an ImageButton or Button both will do for setting the Background to the GUI use android:background=”@drawable/ur_background_name” in the Layout if you dont know about the layouts… then read This but here … Read more

[Solved] Crashing android application [duplicate]

public void onClick(View v) { AlertDialog.Builder a_builder = new AlertDialog.Builder(MainActivity.this); a_builder.setCancelable(false); a_builder.setTitle(“Alert !”); a_builder.setMessage(“do you want to call!!!”); a_builder.setPositiveButton(“Yes”, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { //handle the permission at start. if (ActivityCompat.checkSelfPermission(MainActivity.this, Manifest.permission.CALL_PHONE) != PackageManager.PERMISSION_GRANTED) { //permission not granted, ask for permission return; } Intent callIntent = new Intent(Intent.ACTION_CALL); callIntent.setData(Uri.parse(“tel:0000000000”)); … Read more

[Solved] How to hide a Floating button under textview while scrolling the texts

Try this, if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { mScrollView.setOnScrollChangeListener(new View.OnScrollChangeListener() { @Override public void onScrollChange(View v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) { if (scrollY > 0 && fab2.isShown()) { fab2.setVisibility(View.GONE); } else if (scrollY < 0) { fab2.setVisibility(View.VISIBLE); } } }); } else { mScrollView.getViewTreeObserver().addOnScrollChangedListener(new ViewTreeObserver.OnScrollChangedListener() { @Override public void onScrollChanged() { int … Read more

[Solved] android – Place imageview next to two textviews under each other

First add dependencies in your gradle file for circular image view compile ‘de.hdodenhof:circleimageview:2.1.0’ now you can use below code as per your requirement <?xml version=”1.0″ encoding=”utf-8″?> <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:app=”http://schemas.android.com/apk/res-auto” android:layout_width=”match_parent” android:layout_height=”match_parent” android:orientation=”vertical”> <LinearLayout android:layout_width=”match_parent” android:layout_height=”wrap_content” android:orientation=”horizontal” android:weightSum=”3″> <LinearLayout android:layout_width=”0dp” android:layout_height=”match_parent” android:layout_weight=”1″ android:gravity=”center”> <de.hdodenhof.circleimageview.CircleImageView android:id=”@+id/meal_image_order” android:layout_width=”96dp” android:layout_height=”96dp” android:src=”https://stackoverflow.com/questions/44897138/@color/colorAccent” app:civ_border_color=”@color/colorPrimaryDark” app:civ_border_width=”2dp” /> </LinearLayout> <LinearLayout android:layout_width=”0dp” android:layout_height=”match_parent” android:layout_weight=”2″ … Read more

[Solved] Is it possible that many layout in one layout in android? [closed]

Activities consist of different layouts.Only one layout can run in one activity.But Fragments can be used in this respect.You need to add frame layout at the places where you need different layout.Fragments have similar life cycle as compare to that of the activities.You will need to create fragments and add it in the activity through … Read more

[Solved] What is the difference between Android Material Design UI and Android UI without material design?

You simply have to provide UI which fits the suggestions and rules from https://material.io/guidelines/ That resource does describe, for example, minimum sizes for UI elements, padding, margin, etc. For the newest SDK versions of android most of these rules are already applied into default ui elements in Android Studio. 0 solved What is the difference … Read more

[Solved] Creating Android UI dynamically in java code

I think you are missing the basic point here 🙁 When you want to update an already-existing layout, you shouldn’t inflate a new one. Instead, you fetch the views you want to update and put the data in them. Like this: TextView t = myLayout.findViewById(R.id.someTextViewId); t.setText(newlyObtainedData); As for the Context, every activity inherits after it, … Read more

[Solved] How to put a border in an EditText? [duplicate]

just try this one, first create one XML file, inside drawable folder (use new drawable xml) and add this lines <?xml version=”1.0″ encoding=”utf-8″?> <shape xmlns:android=”http://schemas.android.com/apk/res/android” android:shape=”rectangle”/> <solid android:color=”#000000″/> <stroke android:color=”#ffffff” android:width=”05dp”/> <corners android:radius=”20dp”/> then add this line inside Your edittext property android:background=”@drawable/(file_name)” i don’t know what your expecting, maybe it will help you solved How … Read more

[Solved] How can I center the title of navigation drawer application?

Here inside Toolbar inserted a textview with gravity = “center” and disable default title by java. Try with below code : <android.support.design.widget.AppBarLayout app:elevation=”0dp” android:layout_width=”match_parent” android:layout_height=”wrap_content” android:theme=”@style/AppTheme.AppBarOverlay”> <android.support.v7.widget.Toolbar android:id=”@+id/toolbar” android:layout_width=”match_parent” android:layout_height=”?attr/actionBarSize” android:background=”?attr/colorPrimary” app:popupTheme=”@style/AppTheme.PopupOverlay” > <TextView> android:layout_width=”wrap_content” android:textSize=”18dp” android:layout_height=”wrap_content” android:gravity=”center_horizontal” android:text=”Title Here” android:textColor=”@color/white” /> </android.support.v7.widget.Toolbar> </android.support.design.widget.AppBarLayout> java code disable your title : Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); … Read more