android


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.

Related Links

Android studio :com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry
Drawer Views not showing
Google Auth sign in profile given name and family name empty when authenticating for the first time
non localizable string xml
Which one is faster Color Filtering or use different drawables in android?
How to draw a thick dash line using xml?
How to show loaded reward video in adMobPro?
Firebase 3.0 createUserWithEmailAndPassword() error handling
ruby on rails and android: How does JWT really work here
Error Inflating Navigation View
How do I retrieve data from the wearable API from within an intentService?
How to show complete image in Navigation drawer background
How to get child by its position?
User coming back null even in if statement
Android) How to get UserInfo(openID, token) for WeChat Login?
Error:(25, 46) error: #InjectViews must be a List or array

Categories

HOME
android
delphi-7
apache-flink
phpmyadmin
powerpoint
flex
composite-primary-key
devise
r-googlesheets
pdfbox
maxscript
google-admin-sdk
banner
barcode
fosrestbundle
augeas
32bit-64bit
mel
watson-conversation
tput
supervisor
favicon
pybossa
dynatrace
atlassian
scrolltop
qsqlquery
dynamic-sql
forgot-password
boost-icl
microsoft-ocr
kendo-mobile
backpack-for-laravel
postscript
imageresizer
roundup
xunit
mount
android-sharedpreferences
motion-detection
rpgle
sinch
playstation-portable
wacom
gojs
vue-chartjs
sql-delete
openproject
watchman
sim-card
gdata
mongoose-schema
signals-slots
datacachefactory
movilizer
oracle-service-bus
knime
android-checkbox
pom.xml
carrot2
vibrate
smartfoxserver
google-query-language
redis-cluster
uiactionsheet
invoke-sqlcmd
blitline
contentcontrol
iokit
opserver
ocra
rrule
umlgraph
angular-gettext
rmysql
gii
personalization
ora-00904
grails-plugin-rabbitmq
getopt
scriptaculous
hidapi
tlf
scringo
kaleidoscope
abstract-data-type
mantle
curb
panda3d
iboutlet
pyunit
adobe-media-server
cuteeditor
commerceserver2007
undefined-index
silent
django-piston
web-application-project
dsoframer

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App