| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- /*
- * Copyright (c) 2006-2024 LOVE Development Team
- *
- * This software is provided 'as-is', without any express or implied
- * warranty. In no event will the authors be held liable for any damages
- * arising from the use of this software.
- *
- * Permission is granted to anyone to use this software for any purpose,
- * including commercial applications, and to alter it and redistribute it
- * freely, subject to the following restrictions:
- *
- * 1. The origin of this software must not be misrepresented; you must not
- * claim that you wrote the original software. If you use this software
- * in a product, an acknowledgment in the product documentation would be
- * appreciated but is not required.
- * 2. Altered source versions must be plainly marked as such, and must not be
- * misrepresented as being the original software.
- * 3. This notice may not be removed or altered from any source distribution.
- */
- package org.love2d.android;
- import android.content.Intent;
- import android.content.pm.PackageManager;
- import android.net.Uri;
- import android.os.Bundle;
- import android.widget.Button;
- import android.widget.TextView;
- import androidx.appcompat.app.AppCompatActivity;
- public class AboutActivity extends AppCompatActivity {
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_about);
- // Set button click listener
- Button button = findViewById(R.id.button);
- button.setOnClickListener(v -> {
- Uri uri = Uri.parse("https://love2d.org/");
- Intent intent = new Intent(Intent.ACTION_VIEW, uri);
- intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
- startActivity(intent);
- });
- // Set version
- try {
- String version = getPackageManager().getPackageInfo(getPackageName(), 0).versionName;
- TextView versionText = findViewById(R.id.textView4);
- versionText.setText(getString(R.string.version_info, version));
- } catch (PackageManager.NameNotFoundException ignored) {
- }
- }
- }
|