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

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?

Categories

HOME
django
webdriver
pagination
solaris
can
seo
static-site
xbee
mips
3d-reconstruction
pyqt4
azure-container-service
lanczos
spin
java.util.logging
rtf
code-generation
cfml
springfox
aggregation
soot
spotipy
boost-asio
autodesk-designautomation
xbox
postback
python-2.6
quickfixj
gnat-gps
classcastexception
joomla2.5
hunspell
reverse
sql-delete
processwire
apiary.io
connection-pool
projects-and-solutions
gdata
opensmpp
dcmtk
datacachefactory
ssrs-2014
contract
android-checkbox
double-click
ovf
openrasta
podscms
trojan
reindex
android-testing
avx
oozie-coordinator
mouseleave
template-toolkit
rmongo
cronexpression
gogs
xdoclet
riot
angular-ui-typeahead
thread-sleep
visual-sourcesafe-2005
evolus-pencil
uncompress
vacuum
skspritenode
linked-tables
cakephp-2.7
exceldatareader
rapidsvn
angular-gettext
jama
gii
ss7
jquery-slider
spring-remoting
drupal-nodes
git-repo
gd-graph
onload-event
boost-msm
faye
virtualpathprovider
google-maps-mobile
landscape-portrait
mysql-error-1205
umra
clrstoredprocedure
msr
codebase
web-garden
purepdf
feasibility
fdf
contentpresenter

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