Can't add WebViewFragment derived class to FragmentTransaction

stackoverflow.com - 2012-03-03 09:45:13 - Similar - Report/Block

I am using ActionBarSherlock and implementing a tabbed app. Each tab represents a Fragment that contains nothing but a WebView. I've got it implemented with my object derived from Fragment. But when I changed it to WebViewFragment, I can no longer add it to the FragmentTransaction. I'm wondering if I importing the right things? Here'...

I can't assign from pointer to pointer to derived class and pointer to pointer to base class? [closed]

stackoverflow.com - 2012-07-11 16:20:46 - Similar - Report/Block

Possible Duplicate: Conversion between Derived** to Base** I'm getting back into C++ after several years of mostly Python, and am hitting up against a strongly-typed wall. I think I have a good handle on basic polymorphism and type-casting between pointers of base and derived classes (e.g. Can a pointer of a derived class be type cast to...

Store derived object in vector of base type

stackoverflow.com - 2013-04-04 22:45:43 - Similar - Report/Block

I have a std::vector of pointers of a base class type: vector baseList; And I push a derived class type onto the vector: Derived* derivedObject = new Derived(); baseList.push_back(derivedObject); But when I iterate the list and call the function which is overridden from the base class by the derived class the code in the derived class isn...

C++ self referencing object and inheritance

stackoverflow.com - 2013-04-23 00:33:09 - Similar - Report/Block

I have a parent class which as a member contains an array of pointers to objects of the same type as itself. I have another class that derives from the parent class. I want that the derived class uses an array of pointers to objects of its own (not the parent class). The deriving class calls methods on those objects that are stored in the...

overriding a const method of the Base class from the derived class

stackoverflow.com - 2012-03-25 20:49:54 - Similar - Report/Block

class Base{ //... public: int get()const{ // const // Do something. } int get(int x){ // Do Someting. } //... class Derived:public Base{ //.... public: int get(){ // not const (not the same signature as the one is the base class) //Dosomething } //... I know that get() in Derived...

Remove a fragment which is not put to stack in my case

stackoverflow.com - 2012-03-14 11:37:44 - Similar - Report/Block

Suppose I have two fragments: firstFragment , and secondFragment I know I can replace a fragment by: fragmentTransaction.replace(R.id.fragmen t_placeholder, firstFragment); fragmentTransaction.setTransition(Fragme ntTransaction.TRANSIT_FRAGMENT_FADE); fragmentTransaction.commit(); Like the above code shows, I did not add the above firstFrag...

Calling a non-virtual function in derived class using a base class pointer

stackoverflow.com - 2013-05-15 13:45:42 - Similar - Report/Block

As noted in this answer high reliance on dynamic_cast is often an indication your design has gone wrong. What I'd like to know is how can I call a custom function in a derived class, for which there is no same-name function in the base class, but do so using a base class pointer and perhaps without dynamic_cast if in fact there is a bett...

Does C++11's decltype make clone unecessary?

stackoverflow.com - 2012-05-03 04:32:05 - Similar - Report/Block

clone paradigm is used to make a copy of a derived class without casting down to the base class type. Unfortunately, clone must be implemented in each subclass (or with a mixin with CRTP). Is there any chance that C++11's decltype makes this unecessary? I don't think the code below actually copies original , but simply points a referen...

searching for the whole list of derived classes of a base class in a big C++ project

stackoverflow.com - 2013-05-08 15:05:20 - Similar - Report/Block

I am working on a huge C++ project. I am using Netbeans to edit it, as the compilation takes place on a linux server. I have a problem of getting the whole list of derived classes that inherit from a base class. There is a protected variable in the base class and I want to takle it in the derived classes that inherit it, but how do I know...

C++: Throwing shared_ptr of derived and catching shared_ptr of base?

stackoverflow.com - 2012-03-30 11:15:48 - Similar - Report/Block

Ok, I've been told this problem: Why can you throw a pointer to a derived class and catch a pointer to its base... but you can't do that with shared_ptrs? Example, this works: class Base {}; class Derived : public Base {}; int main() try { throw new Derived() ; } catch( const Base2 * b ) { printf(...

converting from vector ::iterator to vector ::iterator

stackoverflow.com - 2013-03-13 20:07:54 - Similar - Report/Block

Is it possible to do the operation described in the title? Here is a concrete example of what I want to do: #include class Base{ public: Base(int t){tst = t;} protected: int tst; class Derived : public Base{ public: Derived(int t):Base(t){} int main(){ std::vector test; test.push_back(Derived(1)); std::vector::iterator iTest = test.

Why adds OnCreateView the child fragments multiple times?

stackoverflow.com - 2013-03-18 11:14:28 - Similar - Report/Block

When onCreateView called second time it adds another instance of MyFragment. For example when this Fragment comes back from back stack, it shows two instances of MyFragment. Why? How should I prevent it? @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inf...

evolveStar Join

What the need for abstract class here?

stackoverflow.com - 2012-03-19 18:19:09 - Similar - Report/Block

One of the interview questions which they asked me very recently. What is an abstract class in C#? Abstract Class - is a class which cannot be instantiated & can include abstract or instance methods, constructors etc. Instance methods can be used for implementing common functionality for all derived classes which inherits this abstr...

Custom Fragment cannot be cast to other custom Fragment

stackoverflow.com - 2012-06-10 15:34:39 - Similar - Report/Block

I try to simply replace one custom fragment by another one. The first custom fragment is called MenuFragment and extends ListFragment . When the activity is created (onCreate) I insert it in a layout (called layout_container ) I've defined in XML : FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction(); MenuFra...

Capture Return Value of Method returning base type or derived type

stackoverflow.com - 2013-06-03 12:58:41 - Similar - Report/Block

I have a JAVA method which can return an instance of a base class(Say A) OR an instance of the derived class(say B) depending on the Runtime input. ( B derives from A) Now , in cases when the method returns an object of type 'B' , how do I assign it to a reference of type 'B' ? I can't just assign it to a reference of base type , because...

Typecasting and inheritance in C++

stackoverflow.com - 2012-03-31 06:41:44 - Similar - Report/Block

I have a problem. There are two classes: struct Base { Base* retain() { //retain here return this; } struct Derived : Base { Derived *d1 = new Derived(); Derived *d2 = d1->retain(); //error here: need to typecast to Derived* Derived *d3 = (Derived*)d1->retain(); //OK Is there any way to rewrite retain() function...

Virtual function call from a normal function

stackoverflow.com - 2012-04-15 13:06:58 - Similar - Report/Block

class base public: void virtual func(){cout<<"base";} void check() { func(); } class derived: public base public: void func(){cout<<"dervied";} int main() base *obj = new derived(); obj->check(); return 0; Above code prints derived on the console. Now, I understand the concept of virtual functions but I'm unable to...

Overloading functions with derived classes

stackoverflow.com - 2013-05-31 12:02:50 - Similar - Report/Block

What I'm trying to do is something like this: void SomeFunction(Base *){//do something} void SomeFunction(Derived *){//do something else} Is this possible in C++? My attempts so far just call the base version of the function. Here is an example for some clarity. Example: #include #include class Base public: Base () {std::cout << "Base C...

Base class DTO or derived class DTO in service contracts

stackoverflow.com - 2012-07-19 18:03:34 - Similar - Report/Block

What's the better approach: using derived class in the service contracts (interface)? Or using the less specific class (the base class)? Suppose I have the base classes RequestDto ResponseDto , all other classes inherit from one of them. Is it a good practice to have all my methods receive or return this object, then I make the correct ca...

How to get derived class from abstract base class

stackoverflow.com - 2013-03-04 07:36:29 - Similar - Report/Block

I am using an abstract class and i have a class that use it, this class is singleton class. I want to use the abstract class in a different class to get and have the instance from the base class. I adding a code example that i hope will help to explain my question Abstract Class (It is generic class) public abstract class BaseAbstract whe...

Derived and Base type differentiation

stackoverflow.com - 2012-02-27 15:29:09 - Similar - Report/Block

Lets say that we have the following code Base() { ... } Derived : Base { ... } Main() var derivedInstance = new Derived(); if(derivedInstance is Base) { DoStuff(); } The if statement that we have returns true. How do I differentiate between the derived type from the base type when I am working with a derived inst...

Does a member of a C++ base class really needs to be virtual to be overridden by a derived class?

stackoverflow.com - 2013-02-12 19:22:14 - Similar - Report/Block

class A { public: virtual int test()=0; class B : public A { public: int test(){return 10;} B *b = new B(); b->test(); // would return 10; whereas: class A { public: int test(){return 0;} class B : public A { public: int test(){return 10;} B *b = new B(); b->test(); // **would return 0**; Why does it return " " here? This makes ze...

How can i use ImageFetcher(iosched) with ActionBarSherlock + mapview?

stackoverflow.com - 2013-03-08 16:40:17 - Similar - Report/Block

I'm using the version of ActionBarSherlock which allows me to use ActionBarSherlock + MapView. Now, i'm trying to show a mapview and a listview, but the listview has some items with url images. I wan to use the ImageFetcher of iosched, but the method getImageFetcher (of iosched) just allows the type FragmentActivity. What can i do in this...

Android: Datepicker dialog - TimePickerDialog.OnTimeSetListener

stackoverflow.com - 2013-05-14 10:51:23 - Similar - Report/Block

I am newbie in Android, here I am again with another "simple" question. I hope you can help me. I just want a button that displays a TimePicker in a dialog. When I set the time in timepicker I would like to get selected time. I am using android support library and ActionbarSherlock. Here is my code: AddPeriod.java import android.app.Alert...

Error Accessing object within object VBA

stackoverflow.com - 2012-09-14 21:53:32 - Similar - Report/Block

I have a class which implements another object. I set a property function for each property of the implemented object but keep getting an 'Invalid use of property' error. Here's my code: Test Sub: Sub tst() Dim a As Derived Set a = New Derived a.Base_name = "ALGO" 'Error happens when this executes End Sub Derived class module: Option Expl...

Invalid Allocation Size (in derived class copy constructor)

stackoverflow.com - 2012-03-17 16:16:03 - Similar - Report/Block

I have narrowed down my issue to a derived classes copy constructor, but I am unsure of the cause. EDIT: M, N and Data are Private. The error I recieve is 'Invalid allocation size: 4294967295 bytes' - which I understand is caused when passing a -1 to new. I'm unsure why this would occur unless the data is lost when the class comunicate.

FragmentTransaction in support-v4 does not have detach()?

stackoverflow.com - 2012-03-19 14:37:16 - Similar - Report/Block

I've been looking far and wide for solutions to this but alas in my sample project I still get the following errors "The method isDetached() is undefined for the type Fragment" "The method detach(Fragment) is undefined for the type FragmentTransaction" What is the matter here? I have the following imports import android.content.Context; i...

how to set an onClick event in progressbar with ActionbarSherlock?

stackoverflow.com - 2013-03-15 14:31:44 - Similar - Report/Block

Im using the setSupportProgressBarIndeterminateVisibi lity(true) to show a progressbar in the ActionbarSherlock. How can I set an onclick event to the image? Thanks.

MVC4 / EF / Code First - What is the correct way to instantiate an ICollection in a derived class

stackoverflow.com - 2013-03-25 12:12:36 - Similar - Report/Block

I'm trying to new ICollections in my derived classes - should this be done in the object constructor or/and when I'm creating a new instance of an object in my Register ActionResult() Tenant inherits from UserProfile - simplified example: public class Tenant : UserProfile public Tenant() this.ReferencePhotos = new List(); // Reference...

Why can you throw anything in Java?

stackoverflow.com - 2013-03-04 11:05:51 - Similar - Report/Block

In Java theoretically you can throw only Throwables This is allowed by the language and checked during class-loading. But if you disable class checking, then you can run a class that throws any class (not derived from Throwable Why? Why is it designed this way .. meaning a virtual machine that allows throwing objects and a verifier that...

C++ Inherit from unknown intermediate class(es) with known base class

stackoverflow.com - 2013-04-30 02:13:48 - Similar - Report/Block

I have an abstract class, called UsbDevice (mostly pure virtual). It doesn't do much, but the three derived classes do: class WindowsUsbDevice : public UsbDevice class LinuxUsbDevice : public UsbDevice class OsxUsbDevice : public UsbDevice each of these classes doesn't really add any public methods - instead they are just different implem...

C++ - base implementation called through reference of derived?

stackoverflow.com - 2013-05-02 00:37:40 - Similar - Report/Block

Consider following code (minimal version): #include struct Base virtual ~Base() {} virtual void test() const { std::cout << "base"; } struct Derived : public Base void test() const { std::cout << "derived"; } struct Composite const Derived &ref; Composite(const Derived &ref) : ref(ref) {} void testRef() const { ref.test(); } int mai...

SherlockListFragment setRetainInstance(true) doesn't work as expected

stackoverflow.com - 2013-02-25 12:02:47 - Similar - Report/Block

I use setRetainInstance(true) on SherlockListFragment , and expect it to not destroy and re-create itself during screen rotation. However, it doesn't. It still calling onActivityCreated each time I perform rotation. WatchlistFragment.java package org.yccheok.jstock.gui; import android.os.Bundle; import android.util.Log; import android.v...

Organic PG & VG USP base bases?

e-cigarette-forum.com - 2013-03-20 19:46:11 - Similar - Report/Block

I always read 's 'an organic compound" and don't know if that means it's organic like an organic plant grown clean. I think always/usually comes from coal anyway and can't be made organically, but not sure. If it makes sense, I hope to DIY with Organic and I did a search but didn't find much on this. I googled "organic vegetable glyceri...

A custom system class loader is not used by all classes

stackoverflow.com - 2012-04-20 13:12:34 - Similar - Report/Block

I'm implementing a feature that requires passing dynamically generated types (in binary representation, serialised with Kryo) between several instances of JVM (over the network). In order to properly resolve what types are loaded and what are not I use a custom system class loader (passed as java -Djava.system.class.loader parameter), wh...

Is it possibly to impose type constraints on a generic member of a class in an inheritance hierarchy?

stackoverflow.com - 2012-04-10 22:26:37 - Similar - Report/Block

I'm writing an application in C#, and am wrestling with its implementation of generics. I have an inheritance hierarchy that is mirrored by another inheritance hierarchy (Models and View Models) like so: class A_Content { } class B_Content : A_Content public string Bar; class C_Content : A_Content public string Foo; class A { public A_C...

Binary operator overloading and polymorpism

stackoverflow.com - 2012-04-06 23:08:25 - Similar - Report/Block

I'm trying to make an operator that will allow me to add an integer to one of my classes, but I'm having trouble as follows. struct Base //Will have value of zero struct Derived : public Base int value_; int & operator+=(int & num, Base & b); int & operator+=(int & num, Derived & d); With the operator implementa...

Adding additional properties without having to overwrite base properties

stackoverflow.com - 2012-02-27 18:08:48 - Similar - Report/Block

I have a number of classes deriving from an abstract base class. The concrete classes are stored in a container by references to base class. The concrete classes have many properties which are used to bind to pages in a FixedDocument. I want to add aditional properties to the concrete classes at runtime which will also bind to the FixedDo...

Porting a class from MFC to a C++ Console Application . Building MFC application with /MD[d] (CRT dll version) requires

stackoverflow.com - 2013-03-21 00:07:47 - Similar - Report/Block

I am trying to port a certain functionality from an MFC based application. Apparently I have no experience with MFC . The class of my interest inherits from CAsyncSocket. When looking that class up on MSDN , it states that the class is derived from afxsock.h . When I added that to my console application code I got the following error mes...

Помощь при добавлении Actionbarsherlock - Программирование Android

cyberforum.ru - 2013-06-09 20:36:32 - Similar - Report/Block

Привет всем. Подскажите кто знает как к проекту в Idea Intellij добавить Actionbarsherlock? Я делал таким образом: 1) Скачал архив Actionbarsherlock с оф. сайта (в нем несколько папок). 2) Создал новый проект. Далее в IDE сделал File - Import module. Тут есть вопрос - Что импортировать, весь корневой скачанный каталог или какой-то вложены...


Fill out the form you see below. Registration is free, fast and simple.
If you are already registered, sign in page login.

Web Site :
Required Field
First Name :
Required Field
Last Name :
Required Field
Email :
Required Field
Sex :
Required Field

evolveStar.com is free for ever !

evolveStar.com provides a search engine that allows you to gather information to write their own blog.

evolveStar.com enhances the sources displaying the logo of the site.

If you want to remove your site or you believe a site listed infringes copyright, please report it to: info@evolvestar.com

Specifies the subject copyright violation and the url of the page

evolveStar.com respecting the law DMCA (Digital Millennium Copyright Act) will immediately remove whatever its merits.

Next will be effectual and relevant checks.

Who We Are Partner Advertising Contacts Privacy terms Help & FAQ

© Copyright 2010-2017 Fabrizio Fichera. All rights reserved.