android


how to load new content in linear layout android using fragment?


As we load Webview in fragment like this:
private WebView viewer = null;
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
viewer = (WebView) inflater
.inflate(R.layout.tut_view, container, false);
return viewer;
}
public void updateUrl(String newUrl) {
if (viewer != null) {
viewer.loadUrl(newUrl);
}
}
But i wanted to use linear layout instead of webview.
I try this but errors come out.
private LinearLayout viewer ;
#Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
viewer = (LinearLayout) inflater.inflate(R.layout.tut_view, container, false);
View fragment = inflater.inflate(R.layout.tut_view, null);
return viewer;
}
public void updateUrl(String newUrl) {
if (viewer != null) {
}
}
You should have LinearLayout as root in your xml file. Also you do not need to cast the inflated view as return type is View. Please read the fragment spec.

Related Links

open App from google calendar Android
Auto Page Refresh/Reload function android
Android Media palyer by FFmpeg2.3.3 and SDL2-2.0.3 has a error when SDL_init().The error is about SDL_main.h
Unable to display AlbumArt in RemoteMediaController while casting from sender
Android spinner prompt
How to finish activity from service class in android?
Can't i add android-17,android-18 etc platforms in android studio?
RSA Publickey implemenation in android
What i should write in Pro-guard Files to stop reverse engineering android?
CreateProcess error=206, The filename, or extension is too long
GPS code returning last location
User Defined Target in Rajwali-Vuforia
Android widget listview swipe to remove item
my page does not display all the content on android
Passing a parameter in Raw SQL Ormlite
Android conditional permissions

Categories

HOME
notepad++
delphi-7
c++11
webdriver
ecmascript-6
formal-languages
components
sitecore
nsbundle
echo
pearson-correlation
azure-container-service
angularfire2
openstreetmap
owin
x-cart
datastage
filechannel
angular-dart
jsonpath
endpoint
bitnami
google-data-studio
topology
database-connection
windows-xp
ag
href
gulp-watch
event-store
qliksense
pic32
android-maps
comparable
iis-express
mql
panoramas
record
dumpbin
twos-complement
instantiation
sharding
modalviewcontroller
openerp-7
timing
sessionstorage
outputcache
vaadin-charts
x++
jide
magento-2.0.7
yii2-api
pair-programming
tinkerpop
pdf-conversion
google-photos
ampps
cronexpression
cubism.js
ng-grid
hclust
eigenvector
riot
bizagi
hadoop-partitioning
zen-cart
cgi-bin
lasso
haskell-warp
telepat
android-broadcast
xmltype
rapidsvn
spy++
machine-instruction
trdion2011
unix-socket
template-deduction
ss7
malformedurlexception
memset
draw2d-js
radiant
accesscontrolexception
xmltodict
openargs
model-driven-development
swfobject
veracity
os.system
garbage
predicatebuilder
hibernateexception
convention
htdocs
qglwidget
office-2007
wcf-instancing
wordprocessingml
cldc

Resources

Encrypt Message