Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

android - Neither constructor nor onFinishInflate called for custom view -


i have custom view (which extends glsurfaceview) i'm trying use in app. xml layout uses appears being loaded correctly (attributes set view applied), neither view's constructor nor onfinishinflate method being called class. should add i'm new android platform stupid mistake.

here main.xml

<?xml version="1.0" encoding="utf-8"?> 

#<!-- status bar --> <linearlayout      android:orientation="horizontal"     android:layout_width="match_parent"      android:layout_height="wrap_content"     android:layout_weight="0"     android:background="@drawable/status_bkg">      #<!-- location label -->     <textview          android:text="location"          android:textcolor="#ffffff"         android:layout_weight="1"          android:layout_width="match_parent"         android:layout_height="wrap_content" />      #<!-- date/time label -->     <textview          android:text="date , time"          android:textcolor="#ffffff"         android:layout_weight="1"          android:layout_width="match_parent"         android:layout_height="wrap_content"         android:gravity="right"  /> </linearlayout>  #<!-- chartview --> <view class="com.xxx.yyy.chartview" android:id="@+id/chartview"     android:layout_width="match_parent"      android:layout_height="match_parent"     android:background="#00ff00"      android:layout_weight="1"> </view> 

the chartview custom glsurfaceview. layout loaded , chartview has green background specified. however, none of setup (in code) happens it. i've tried placing in 2 constructors , in onfinishinflate methods, inexplicably don't called. i've verified class name correct (the xxx.yyy hide company in post.

i've tried different form of xml reference

    <com.xxx.yyy.chartview android:id="@+id/chartview"     android:layout_width="match_parent"      android:layout_height="match_parent"     android:background="#00ff00"      android:layout_weight="1"/> 

but dies when loading activity says constructor

chartview(context context, attributeset attrs)

doesn't exist (although in code).

anyone got tips on going on?

i figured out. had defined constructor (the 1 not getting called) as:

public chartview( myactivity context, attributeset attrs ) {     super( context, attrs ); ….         } 

however, started working when changed constructor be:

public chartview( context context, attributeset attrs ) {     super( context, attrs ); ….         } 

given myactivity extends activity (which extends context), valid code , believe should work (it compiles). seem there error in reflection system using in locating method.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -