Is it okay to use the same layout for two different activities?
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <Button android:id="#+id/button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" android:layout_marginBottom="92dp" android:text="Start Download" /> </LinearLayout> Both activities have to perform the same things.The only difference is the type of data they handles. Just for curiosity I am asking this question.
Yes, there's no problem with that technically. Just remember that if you change anything for one activity it will change for both, so its best suited for very simple layouts. But frequently I'll use the same placeholder for 4 or 5 activities that aren't written yet, or I'll use the same layout for placeholder listview elements.
Images get pixelated when the screen is touched
PhoneStateListener and ContentObserver, do I need to unregister?
Android activity name
Custom android Spinner?
Hello Android Stops Unexpectedly
AsyncTask in Loop?
App force closes when the database is empty
devicePolicyManager.lockNow() is not working for Motorola Tablets
Sharing an image with Google+ app using Intent.ACTION_SEND and Intent.EXTRA_STREAM
some problems with Android Bitmap in Out of Memory
Flowchart for complete Android application
Android: Change emulator datetime using our application
Creation of EditText Dynamically and get their text from each of EditText
Dynamic Edittext & TextBox
Getting all contact details which have a phone numbers in Android
How can I dump ALL of a contact's phone numbers?