Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
package drivecrm.pkg.inventorypkg.common;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import drivecrm.pkg.inventorypkg.R;
public class ActivityBase extends Activity
{
@Override
protected void onCreate(Bundle savedInstanceState)
{
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
Log.d("TAG", "Activity Base onCreate called:");
}
public void onFinishInitViews1()
{
// TODO Auto-generated method stub
Log.d("TAG", "Init over");
try
{
LinearLayout llMain = (LinearLayout) findViewById(R.id.top);
View secondLayout = llMain.getChildAt(1);
if (secondLayout != null)
{
LayoutInflater inflator = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
LinearLayout rlHeader = (LinearLayout) inflator.inflate(R.layout.main_header_view, null);
if (secondLayout instanceof LinearLayout)
{
((LinearLayout) secondLayout).addView(rlHeader, 0);
}
}
else
{
Log.d("TAG", "No top found");
}
}
catch (Exception e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment