Questions tagged [outer-classes]
49 questions
0
votes
3 answers
Android: Implement inner class in outer class; callback from inner class and outer class
I have multiple fragments in one activity that should be able to pass data inbetween them. I have used tutorials to implement callbacks. My MainActivity is the outer class in which my fragment classes are. Furthermore I have a FragmentPagerAdapter…

timolemow
- 195
- 1
- 2
- 8
-1
votes
1 answer
Initialize Inner Class with outer class this possible?
Today i tried to instanciate an inner class while passing my outer class to it and while i am in the namespace of the outer class:
I'm using Visual Studo 2013.
Code looks like this : (watch the ^^)
class Base
{
public:
virtual void foo(){ cout…

Meph
- 370
- 1
- 13
-1
votes
4 answers
Access private variable from inner class (AsyncTask)
I have a problem, I am trying to access a private variable of an outer class from a doInBackground method of an AsyncTask which is the inner class. Here there is the full code.
public class MessageHandler {
private Contact receiver;
private String…

FF91
- 29
- 1
- 11
-1
votes
2 answers
how to restrict setting a property of innerclass just from the outer class in c#
I have the nub of the code like this:
public class OuterClass
{
public static InnerClass GetInnerClass()
{
return new InnerClass() { MyProperty = 1 };
}
public class InnerClass
{
public int MyProperty { get; set;…

Amir Sherafatian
- 2,083
- 2
- 20
- 32