Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7714243
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:04:45+00:00 2026-06-01T02:04:45+00:00

I have a project which I am trying to use in another new project,

  • 0

I have a project which I am trying to use in another new project, my existing project java code is here:

package com.powergroup.splitview;

import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.TextView;

public class SplitviewActivity extends FragmentActivity implements
        Left.OnButtonClickListener {

    LinearLayout LEFT, RIGHT, leftfragmentln, rightfragmentln;
    Right rightFr;
    Left leftFr;


    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //reduced the Gray Bar
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);


        setContentView(R.layout.main);
        // initializes the objects
        initializer();

        // sets the size of the two sides, give the ration here
        setSize(20, 80);
        // sets the colour of the two sides
        setColor(Color.BLUE, Color.RED);

    }

    public void initializer() {
        LEFT = (LinearLayout) findViewById(R.id.lnLeft);
        RIGHT = (LinearLayout) findViewById(R.id.lnRight);
        leftfragmentln = (LinearLayout) findViewById(R.id.lnLeftFragment);
        rightfragmentln = (LinearLayout) findViewById(R.id.lnRightFragment);
        rightFr = (Right) getSupportFragmentManager().findFragmentById(
                R.id.view_right);
        leftFr = (Left) getSupportFragmentManager().findFragmentById(
                R.id.view_left);

    }

    public void setColor(int leftColor, int rightColor) {

        // for landscape mode
        if ((rightFr != null) && rightFr.isInLayout() && (leftFr != null)
                && leftFr.isInLayout()) {

            LEFT.setBackgroundColor(leftColor);
            RIGHT.setBackgroundColor(rightColor);
        } else {
            // for portrait mode
            RIGHT.setBackgroundColor(rightColor);

        }

    }

    public void setSize(float leftsize, float rightsize) {

        // for landscape mode
        if ((rightFr != null) && rightFr.isInLayout() && (leftFr != null)
                && leftFr.isInLayout()) {

            android.widget.LinearLayout.LayoutParams par1 = (LayoutParams) LEFT
                    .getLayoutParams();

            android.widget.LinearLayout.LayoutParams par2 = (LayoutParams) RIGHT
                    .getLayoutParams();
            par1.weight = rightsize;
            par2.weight = leftsize;

        }

    }

    // a method to add view in a blank xml programatically
    public void setView(View leftView, View rightView) {
        if ((rightFr != null) && rightFr.isInLayout() && (leftFr != null)
                && leftFr.isInLayout()) {
            leftfragmentln.addView(leftView);
            rightfragmentln.addView(rightView);
        } else {

            rightfragmentln.addView(rightView);

        }
    }

    @Override
    public void onClickButton(String s) {

        if ((rightFr != null) && rightFr.isInLayout()) {
            rightFr.setText(s);
        } else {
            Intent intent = new Intent(this, RightActivity.class);
            intent.putExtra("value", s);
            startActivity(intent);
        }

    }

}

I have made above code as a library and trying to use in my another project where i can use the above methods. What should I do? Plz Help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T02:04:48+00:00Added an answer on June 1, 2026 at 2:04 am

    Right click on your project.

    Go to build path> Link Source

    Add there the project path what you want to use as a library.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a VB project which I'm trying to configure with three build configurations.
I have a rather enormous project in which I'm trying to retrofit in-memory data.
I have a project which uses groovy 1.7.5 and grails 1.3.4. but my new
I'm trying to use CQRS and EventSorcing in my new project. I'm following the
I have a project in which I am trying to send data from an
I was trying to make another sample from SwipeyTabsSampleActivity developed in android-playground project Here
I'm very new to Java which is required for a Blackberry App development project
I have a project which has some lib's associated with it (in Build Path).
I have a project which requires creating Classes dynamically at runtime, where the only
I have a project which uses php's mt_rand() to generate different random integers but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.