java


Placeholder Fragment / Main Activity android.view.InflateException


I have been searching for a while now, so I am going to ask.
I created a new android project in Android Studio. It automatticaly generates a activity_main.xml & fragment_main.xml .
There is also a MainActivity.java generated containing a public static class for the fragment.
Because I'm new and wan't to see the bigger picture I wanted to seperate the two files but ever since that moment I am getting this error :
java.lang.RuntimeException: Unable to start activity ComponentInfo{...}: android.view.InflateException: Binary XML file line #9: Error inflating class fragment
This is my activity_main.xml
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="genius.ds.config.app.MainActivity"
tools:ignore="MergeRootFrame" >
<fragment
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:name="genius.ds.config.app.PlaceholderFragment"
android:id="#+id/fragment"
android:layout_gravity="center_horizontal|top" />
This is my fragment_main.xml (I believe the error is on line tools:context="..." )
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
android:paddingBottom="#dimen/activity_vertical_margin"
tools:context="genius.ds.config.app.PlaceholderFragment">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/tvDeviceId"
android:id="#+id/tvDeviceId"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
</RelativLayout>
Just to be sure :
MainActivity.java (I changed the extends from ActionBarActivity to FragmentActivity, it was suggested to me on this forum)
public class MainActivity extends FragmentActivity{...}
PlaceholderFragment.java (And I am importing the import android.support.v4.app.Fragment;)
public class PlaceholderFragment extends Fragment {...}
If you need to know more, i will be around to answer your questions :)
Thanx!
Edit 1 - Full LogCat
Link to a file, because SO had troubles formatting :) http://pastebin.com/qAy3Z2sU
Full Fragment Name : genius.ds.config.app.PlaceHolderFragment.java
Full MainActivity Name : genius.ds.config.app.MainActivity.java

Related Links

Java gui background image
how do i issue a raw query using the java client in elasticsearch?
Java if Statement under enhanced for loop did not work [duplicate]
Java Hibernate field access property or property based access
Communication through serial port, java.net.SocketException: Software caused connection abort: socket write error
Gwt Disable Mouse Clicking While Request is Pending
Should we keep symbols/special characters in StringConstants file?
Rehashing method throws NullPointerException
Injecting default Maven project into other Maven components
How add a new element or modify one in a MatOfPoint3f ? (OpenCV, Java)
Error using Object Streams with SSL Sockets
How to measure latency in a wifi network java android
how to create a FB like from my app to a post in a FB page?
Cassandra java reference issue [duplicate]
How to check intersection in libgdx? [closed]
OAuth Callback in the Glass Quick Starter Java App

Categories

HOME
ibm-bluemix
cloud
minimum-spanning-tree
lodash
google-oauth
jpeg
binary-tree
ip
echarts
session-variables
kibana-4
volttron
row
postgres-xl
zend-framework3
size
static-libraries
quickfix
oracle-coherence
text-rendering
beyondcompare
plunker
nas
cx-freeze
replaceall
newline
skia
junit5
siesta-swift
webtest
force-layout
wpf-controls
bytecode-manipulation
suricata
git-merge
restlet
event-driven
android-browser
code-search-engine
unoconv
nomethoderror
http-redirect
flickr-api
parentheses
boost-multi-index
pebble-watch
mplayer
magma
snmptrapd
flutterwave
spring-mongodb
django-scheduler
radtreelist
ado.net-entity-data-model
prettytensor
yaws
r-tree
qtableview
collapse
intellij-14
tmuxinator
streambase
typekit
network-interface
asp.net-dynamic-data
file-copying
bundles
didselectrowatindexpath
srs
monomac
industrial
oam
cdc
aqtime
dir
flashvars
wsdl-2.0
viewswitcher
hosts-file
pydot
psi
propagation
gdlib
w3wp.exe
jquery-ui-droppable
zend-tool
thread-local-storage

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile